Fixed: on-screen widget default border alpha issue
This commit is contained in:
1 parent
94a8caa5df
commit
b7ad4d3562
2 files changed
+7
-6
No files matched your search
@@ -83,7 +83,7 @@
|
|||||||
self.oscLayerSizeFactor = [decoder decodeFloatForKey:@"oscLayerSizeFactor"];
|
self.oscLayerSizeFactor = [decoder decodeFloatForKey:@"oscLayerSizeFactor"];
|
||||||
self.backgroundAlpha = [decoder containsValueForKey:@"backgroundAlpha"] ? [decoder decodeFloatForKey:@"backgroundAlpha"] : 0.5;
|
self.backgroundAlpha = [decoder containsValueForKey:@"backgroundAlpha"] ? [decoder decodeFloatForKey:@"backgroundAlpha"] : 0.5;
|
||||||
self.labelAlpha = [decoder containsValueForKey:@"labelAlpha"] ? [decoder decodeFloatForKey:@"labelAlpha"] : 0.82;
|
self.labelAlpha = [decoder containsValueForKey:@"labelAlpha"] ? [decoder decodeFloatForKey:@"labelAlpha"] : 0.82;
|
||||||
self.borderAlpha = [decoder containsValueForKey:@"borderAlpha"] ? [decoder decodeFloatForKey:@"borderAlpha"] : self.labelAlpha*1.01;
|
self.borderAlpha = [decoder containsValueForKey:@"borderAlpha"] ? [decoder decodeFloatForKey:@"borderAlpha"] : 0.19;
|
||||||
self.borderWidth = [decoder decodeFloatForKey:@"borderWidth"];
|
self.borderWidth = [decoder decodeFloatForKey:@"borderWidth"];
|
||||||
self.widgetShape = [decoder decodeObjectForKey:@"widgetShape"];
|
self.widgetShape = [decoder decodeObjectForKey:@"widgetShape"];
|
||||||
self.minStickOffset = [decoder decodeFloatForKey:@"minStickOffset"];
|
self.minStickOffset = [decoder decodeFloatForKey:@"minStickOffset"];
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ import UIKit
|
|||||||
@objc public var borderWidth: CGFloat = 0.0
|
@objc public var borderWidth: CGFloat = 0.0
|
||||||
@objc public var backgroundAlpha: CGFloat = 0.5
|
@objc public var backgroundAlpha: CGFloat = 0.5
|
||||||
@objc public var labelAlpha: CGFloat = 0.82
|
@objc public var labelAlpha: CGFloat = 0.82
|
||||||
@objc public var borderAlpha: CGFloat = 0.82 * 1.01
|
@objc public var borderAlpha: CGFloat = 0.19
|
||||||
@objc public var vibrationStyle: Int = 6
|
@objc public var vibrationStyle: Int = 6
|
||||||
@objc public var latestTouchLocation: CGPoint
|
@objc public var latestTouchLocation: CGPoint
|
||||||
@objc public var selfViewOnTheRight: Bool = false
|
@objc public var selfViewOnTheRight: Bool = false
|
||||||
@@ -467,13 +467,14 @@ import UIKit
|
|||||||
let realBackgroundAlpha = self.backgroundAlpha - 0.18 // offset to be consistent with legacy onScreen controller layer opacity
|
let realBackgroundAlpha = self.backgroundAlpha - 0.18 // offset to be consistent with legacy onScreen controller layer opacity
|
||||||
self.backgroundColor = UIColor(white: 0.2, alpha: realBackgroundAlpha) // offset to be consistent with legacy onScreen controller layer opacity
|
self.backgroundColor = UIColor(white: 0.2, alpha: realBackgroundAlpha) // offset to be consistent with legacy onScreen controller layer opacity
|
||||||
|
|
||||||
borderAlpha = tweakBorderAlpha ? realBackgroundAlpha * 1.01 : borderAlpha
|
if tweakBorderAlpha {
|
||||||
defaultBorderColor = UIColor(white: 0.2, alpha: borderAlpha).cgColor
|
borderAlpha = realBackgroundAlpha * 1.01
|
||||||
self.layer.borderColor = defaultBorderColor
|
defaultBorderColor = UIColor(white: 0.2, alpha: borderAlpha).cgColor
|
||||||
|
self.layer.borderColor = defaultBorderColor
|
||||||
|
}
|
||||||
|
|
||||||
if widgetType == WidgetTypeEnum.touchPad {
|
if widgetType == WidgetTypeEnum.touchPad {
|
||||||
self.backgroundColor = UIColor.clear // make touchPad transparent
|
self.backgroundColor = UIColor.clear // make touchPad transparent
|
||||||
self.layer.borderColor = UIColor(white: 0.2, alpha: borderAlpha - 0.15).cgColor // reduced border alpha for touchPad
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user