You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the fb_union, fb_difference functions to create a complex bezier path. I'm finding that there are many issues with these functions.
Here is code that generates a rectangle by combining a series of smaller rectangles:
var bezier = UIBezierPath()
for x in 20..<30 {
for y in 15..<20 {
let rect = CGRect(x: x * 10, y: y * 10, width: 11, height: 11)
let bezier2 = UIBezierPath(rect: rect)
bezier = bezier.fb_union(bezier2)
}
}
The width/height is 11 to create a little overlap. From the result I can see that this works, and creates what appears to be a larger rectangle (albeit with a complex single-shape geometry, once printed).
Then I remove every other column, by only drawing columns on even rows:
var bezier = UIBezierPath()
for x in 20..<30 {
if floor(Double(x) / 2) != Double(x) / 2 {
continue
}
for y in 15..<20 {
let rect = CGRect(x: x * 10, y: y * 10, width: 11, height: 11)
let bezier2 = UIBezierPath(rect: rect)
bezier = bezier.fb_union(bezier2)
}
}
The result here is that some of the shapes which should be drawn, inexplicably aren't.
This is an example result - I'm only showing issues with fb_union here, but this issue is very prevalent across uses of these functions. This can be tested using the attached sample project.
I'm using the
fb_union
,fb_difference
functions to create a complex bezier path. I'm finding that there are many issues with these functions.Here is code that generates a rectangle by combining a series of smaller rectangles:
The width/height is 11 to create a little overlap. From the result I can see that this works, and creates what appears to be a larger rectangle (albeit with a complex single-shape geometry, once printed).
Then I remove every other column, by only drawing columns on even rows:
The result here is that some of the shapes which should be drawn, inexplicably aren't.
This is an example result - I'm only showing issues with
fb_union
here, but this issue is very prevalent across uses of these functions. This can be tested using the attached sample project.beziertest.zip
The text was updated successfully, but these errors were encountered: