Navigation
Synopsis Scale a figure.
Function
  1. Figure scale(num perc, Figure fig)
  2. Figure scale(num xperc, num yperc, Figure fig)
Description Currently doesn't work!

Scale figure fig. When only a single percentage perc is given, this applied to the horizontal and vertical dimension.

When percentages xperc and yperc are given they are applied to the horizontal, respectively, vertical dimension.
Examples //b = box(size(100,50), fillColor("Blue")); //render(hcat([b, scale(0.5, b), scale(0.25, b), scale(2, b)])); scale 1
Pitfalls Other properties than dimensions are scaled as well. For instance, lineWidth is scaled (as can be seen in the above example). When this effect is undesired, these properties have to be scaled inversely before scale is applied. Reducing lineWidth to 0.5 and scaling by 2 given a lineWidth of 1: //b = box(size(100,50), fillColor("Blue"), lineWidth(0.5)); //render(scale(2, b)); scale 2
Is this page unclear, or have you spotted an error? Please add a comment below and help us to improve it. For all other questions and remarks, visit ask.rascal-mpl.org.