mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
gg: add Context.draw_cubic_bezier_recursive/2 and Context.draw_cubic_bezier_recursive_scalar/9 (#21749)
This commit is contained in:
parent
fccd7cd02e
commit
4c42fe3420
3 changed files with 72 additions and 3 deletions
|
@ -964,7 +964,7 @@ pub fn (ctx &Context) draw_cubic_bezier(points []f32, c gx.Color) {
|
|||
// The four points is provided as one `points` array which contains a stream of point pairs (x and y coordinates).
|
||||
// Thus a cubic Bézier could be declared as: `points := [x1, y1, control_x1, control_y1, control_x2, control_y2, x2, y2]`.
|
||||
pub fn (ctx &Context) draw_cubic_bezier_in_steps(points []f32, steps u32, c gx.Color) {
|
||||
if steps <= 0 || points.len != 8 {
|
||||
if steps <= 0 || steps >= 20000 || points.len != 8 {
|
||||
return
|
||||
}
|
||||
if c.a != 255 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue