mirror of
https://github.com/joncardasis/ChromaColorPicker.git
synced 2024-09-11 06:35:41 +03:00
Shadow properties are now reflected on handles
This commit is contained in:
parent
2c3749575b
commit
d04eafd96d
@ -125,7 +125,6 @@ public class ChromaColorPicker: UIControl, ChromaControlStylable {
|
||||
let angleToCenter = atan2(location.x - center.x, location.y - center.y)
|
||||
let positionOnColorWheelEdge = CGPoint(x: center.x + radius * sin(angleToCenter),
|
||||
y: center.y + radius * cos(angleToCenter))
|
||||
//print("pos: \(positionOnColorWheelEdge)")
|
||||
location = positionOnColorWheelEdge
|
||||
}
|
||||
|
||||
|
@ -54,6 +54,7 @@ public class ChromaColorHandle: UIView, ChromaControlStylable {
|
||||
public override func layoutSubviews() {
|
||||
super.layoutSubviews()
|
||||
layoutHandleShape()
|
||||
updateShadowIfNeeded()
|
||||
|
||||
layer.masksToBounds = false
|
||||
}
|
||||
@ -67,7 +68,10 @@ public class ChromaColorHandle: UIView, ChromaControlStylable {
|
||||
|
||||
internal func updateShadowIfNeeded() {
|
||||
if showsShadow {
|
||||
let shadowProps = shadowProperties(forHeight: bounds.height)
|
||||
let shadowProps = ShadowProperties(color: UIColor.black.cgColor,
|
||||
opacity: 0.3,
|
||||
offset: CGSize(width: 0, height: bounds.height / 8.0),
|
||||
radius: 4.0)
|
||||
applyDropShadow(shadowProps)
|
||||
} else {
|
||||
removeDropShadow()
|
||||
|
Loading…
Reference in New Issue
Block a user