We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@EfraimB : I did implement drawAdditionalGraphics as below:
public func drawAdditionalGraphics(in context: CGContext, circularSegmentHeight: CGFloat, radius: CGFloat, sliceDegree: CGFloat) {
let iconSize = CGSize(width: 32, height: 32) let iconPadding: CGFloat = 50 let icon = UIImage // my icon let centerOffset = CGPoint(x: -(radius - iconPadding) , y: -iconSize.height/2) let additionalGraphicRect = CGRect(x: centerOffset.x, y: centerOffset.y, width: iconSize.width, height: iconSize.height) let additionalGraphicPath = UIBezierPath(rect: additionalGraphicRect) context.saveGState() additionalGraphicPath.addClip() context.scaleBy(x: 1, y: -1) context.draw(icon.cgImage!, in: CGRect(x: additionalGraphicRect.minX, y: -additionalGraphicRect.minY, width: iconSize.width, height: iconSize.height), byTiling: true) context.restoreGState()
}
Result:
The issue is my icon is showing in wrong slice. Could you please help me to fix it. Thank you
The text was updated successfully, but these errors were encountered:
hi. did you manage to solve it?
Sorry, something went wrong.
Hey, There is an issue in this file FortuneWheelLayer, you can update your code with my solution and solve this issue.
FortuneWheelLayer
Provided by library
//// Aditional graphics drwings parent.slices.enumerated().forEach { (index,element) in self.drawAdditionalGraphics(in: context, rotation: rotation, for: element) let previousSlice:FortuneWheelSliceProtocol = parent.slices[safe:(index - 1)] ?? element rotation += degree(of:previousSlice) }
Edited Solution
//// Aditional graphics drwings parent.slices.enumerated().forEach { (index,element) in self.drawAdditionalGraphics(in: context, rotation: rotation, for: parent.slices[safe:(index - 1)] ?? element) let previousSlice:FortuneWheelSliceProtocol = parent.slices[safe:(index - 1)] ?? element rotation += degree(of:previousSlice) }
Can you please make a PR with this fix? Thank you!
No branches or pull requests
@EfraimB : I did implement drawAdditionalGraphics as below:
public func drawAdditionalGraphics(in context: CGContext, circularSegmentHeight: CGFloat, radius: CGFloat, sliceDegree: CGFloat) {
}
Result:
The issue is my icon is showing in wrong slice. Could you please help me to fix it.
Thank you
The text was updated successfully, but these errors were encountered: