Skip to content

Commit ecbe310

Browse files
committed
Using tap to yield shape
1 parent f78784a commit ecbe310

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

external_library/java/PixelFlow/geometry_grid.rb

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -111,18 +111,20 @@ def display_mesh(ifs)
111111
def create_gizmo(s)
112112
stroke_weight(1)
113113
shp_gizmo = create_shape
114-
shp_gizmo.begin_shape(LINES)
115-
shp_gizmo.stroke(255, 0, 0)
116-
shp_gizmo.vertex(0, 0, 0)
117-
shp_gizmo.vertex(s, 0, 0)
118-
shp_gizmo.stroke(0, 255, 0)
119-
shp_gizmo.vertex(0, 0, 0)
120-
shp_gizmo.vertex(0, s, 0)
121-
shp_gizmo.stroke(0, 0, 255)
122-
shp_gizmo.vertex(0, 0, 0)
123-
shp_gizmo.vertex(0, 0, s)
124-
shp_gizmo.end_shape
125-
shp_gizmo
114+
shp_gizmo.tap do |shp|
115+
shp.begin_shape(LINES)
116+
shp.stroke(255, 0, 0)
117+
shp.vertex(0, 0, 0)
118+
shp.vertex(s, 0, 0)
119+
shp.stroke(0, 255, 0)
120+
shp.vertex(0, 0, 0)
121+
shp.vertex(0, s, 0)
122+
shp.stroke(0, 0, 255)
123+
shp.vertex(0, 0, 0)
124+
shp.vertex(0, 0, s)
125+
shp.end_shape
126+
end
127+
# shp_gizmo
126128
end
127129

128130
def display_gizmo(s)

0 commit comments

Comments
 (0)