Skip to content

Commit

Permalink
draw2D, easy: use Origin for origin fields for triangles
Browse files Browse the repository at this point in the history
  • Loading branch information
larpon committed Dec 16, 2023
1 parent ffaccc2 commit a011e0f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions easy/easy.api.v
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ pub mut:
color shy.Color = shy.colors.shy.red
fills shy.Fill = .body | .stroke
offset vec.Vec2[f32]
origin shy.Anchor
origin shy.Origin
}

@[noinit]
Expand All @@ -250,7 +250,7 @@ pub mut:
color shy.Color = shy.colors.shy.red
fills shy.Fill = .body | .stroke
offset vec.Vec2[f32]
origin shy.Anchor
origin shy.Origin
}

@[inline]
Expand Down Expand Up @@ -316,7 +316,7 @@ pub mut:
scale f32 = 1.0
ray bool
offset vec.Vec2[f32]
origin shy.Anchor = .center_left
origin shy.Origin = shy.Anchor.center_left
}

@[noinit]
Expand All @@ -329,7 +329,7 @@ pub mut:
scale f32 = 1.0
ray bool
offset vec.Vec2[f32]
origin shy.Anchor = .center_left
origin shy.Origin = shy.Anchor.center_left
}

@[inline]
Expand Down
5 changes: 3 additions & 2 deletions lib/draw2d.shape.b.v
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ pub mut:
scale f32 = 1.0
fills Fill = .body | .stroke
offset Vec2[f32]
origin Anchor
origin Origin
}

@[inline]
Expand Down Expand Up @@ -765,11 +765,12 @@ pub mut:
rotation f32
scale f32 = 1.0
offset Vec2[f32]
origin Anchor = .center_left //
origin Origin = Anchor.center_left //
}

@[inline]
pub fn (l DrawShape2DLineSegment) origin_displacement() (f32, f32) {
// TODO
// p_x, p_y := l.origin.pos_wh(l.a.x - l.b.x, l.a.y - l.b.y)
// return -p_x, -p_y
return 0, 0
Expand Down

0 comments on commit a011e0f

Please sign in to comment.