rm push/pop
This commit is contained in:
12
rasterize.cm
12
rasterize.cm
@@ -109,12 +109,12 @@ rasterize.ellipse = function ellipse(pos, radii, opt) {
|
||||
within_wedge(dx+1, dy, wedge_info)
|
||||
|
||||
if (last || !next_in_ring) {
|
||||
push(strips, {
|
||||
strips[] = {
|
||||
x: run_start,
|
||||
y: y_screen,
|
||||
width: (cx + dx) - run_start + 1,
|
||||
height: 1
|
||||
})
|
||||
}
|
||||
run_start = null
|
||||
}
|
||||
}
|
||||
@@ -199,12 +199,10 @@ rasterize.round_rect = function round_rect(rect, radius, thickness) {
|
||||
w = dx_out - dx_in
|
||||
if (w <= 0) continue
|
||||
|
||||
push(strips,
|
||||
{ x:cx_l - dx_out, y:cy_t - dy, width:w, height:1 },
|
||||
strips[] = { x:cx_l - dx_out, y:cy_t - dy, width:w, height:1 },
|
||||
{ x:cx_r + dx_in + 1, y:cy_t - dy, width:w, height:1 },
|
||||
{ x:cx_l - dx_out, y:cy_b + dy, width:w, height:1 },
|
||||
{ x:cx_r + dx_in + 1, y:cy_b + dy, width:w, height:1 }
|
||||
)
|
||||
}
|
||||
|
||||
return {type: 'rects', data: array(rects, strips)}
|
||||
@@ -235,12 +233,10 @@ rasterize.fill_round_rect = function fill_round_rect(rect, radius) {
|
||||
dx = floor(math.sqrt(_radius * _radius - dy * dy))
|
||||
w = (dx << 1) + 1
|
||||
|
||||
push(caps,
|
||||
{ x:cx_l - dx, y:cy_t - dy, width:w, height:1 },
|
||||
caps[] = { x:cx_l - dx, y:cy_t - dy, width:w, height:1 },
|
||||
{ x:cx_r - dx, y:cy_t - dy, width:w, height:1 },
|
||||
{ x:cx_l - dx, y:cy_b + dy, width:w, height:1 },
|
||||
{ x:cx_r - dx, y:cy_b + dy, width:w, height:1 }
|
||||
)
|
||||
}
|
||||
|
||||
return {type: 'rects', data: array(rects, caps)}
|
||||
|
||||
Reference in New Issue
Block a user