Created
February 17, 2022 04:59
-
-
Save AndyDentFree/d91fe267fd6c4ca994e1bf6d4e8fec7a to your computer and use it in GitHub Desktop.
Code reacting to a UI Slider updating line width to outline text.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fileprivate func updatePreviewFromThicknessChange() { | |
if thicknessAdjuster.value != lineWidth { | |
thicknessSwatch.setNeedsDisplay() // refresh assuming value adjusted | |
lineWidth = thicknessAdjuster.value | |
textStyle.drawStyle = textStyle.drawStyle.butWith( | |
lineWidthTenths: Int(lineWidth*10)) | |
updateFontStyling() | |
updateFontDisplay() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment