Optimize meshing

This commit is contained in:
Emil Ernerfeldt
2020-05-11 17:08:04 +02:00
parent 6bee26ca59
commit 4fcea59929
8 changed files with 89 additions and 46 deletions
+4 -4
View File
@@ -157,8 +157,8 @@ fn paint_icon(ui: &mut Ui, state: &State, interact: &InteractInfo) {
));
// Draw a minus:
ui.add_paint_cmd(PaintCmd::Line {
points: vec![
ui.add_paint_cmd(PaintCmd::LineSegment {
points: [
pos2(small_icon_rect.left(), small_icon_rect.center().y),
pos2(small_icon_rect.right(), small_icon_rect.center().y),
],
@@ -168,8 +168,8 @@ fn paint_icon(ui: &mut Ui, state: &State, interact: &InteractInfo) {
if !state.open {
// Draw it as a plus:
ui.add_paint_cmd(PaintCmd::Line {
points: vec![
ui.add_paint_cmd(PaintCmd::LineSegment {
points: [
pos2(small_icon_rect.center().x, small_icon_rect.top()),
pos2(small_icon_rect.center().x, small_icon_rect.bottom()),
],
+1 -1
View File
@@ -256,7 +256,7 @@ fn paint_resize_corner(ui: &mut Ui, interact: &InteractInfo) {
while w < 12.0 {
ui.add_paint_cmd(PaintCmd::line_segment(
(pos2(corner.x - w, corner.y), pos2(corner.x, corner.y - w)),
[pos2(corner.x - w, corner.y), pos2(corner.x, corner.y - w)],
color,
width,
));