scale
Linearly scales the operations within block.
canvas.scale(x = 2.0, y = 2.0) {
rect(Rectangle(10, 10)) // Draws a rectangle that is scaled to 20 x 20
}
Content copied to clipboard
Parameters
x
amount to scale horizontally
y
amount to scale vertically
block
being transformed
Linearly scales the operations within block around the given point.
canvas.scale(around = Point(5, 5), x = 2.0, y = 2.0) {
rect(Rectangle(10, 10)) // Draws rectangle: -5, -5, 20, 20
}
Content copied to clipboard
Parameters
around
this point
x
amount to scale horizontally
y
amount to scale vertically
block
being transformed