User Guide

Ruby Component
“square”, “round”, “triangle”, “noanchor”, “squareanchor”, “roundanchor”, “diamondanchor”, “arrowanchor”
Here is an example that shows how to use line caps:
Scaling
Line caps are scaled automatically in proportion to the line thickness. This scaling can make it difficult to achieve the style you're looking for.
For example, if you create a single pixel thickness line with an arrow end cap the arrow will be just 2 pixels wide.
You can get round this by creating a thicker pen and then scaling it down using the scaleTransform method. The end cap is inversely
affected by the scaleTransform and so if you find a scale factor that maintains the .
scaleTransform sf-x, sf-y
resetTransform
The scaleTransform method takes x and y scale factors – these are floats with 1.0 meaning no change. There is also a resetTransform
method which is useful if you're reusing the same pen and resets any applied transforms.
The example below shows a single pixel width line with an arrow end cap. Below it are two identical lines but with larger arrows using the
technique we just described.
145 of 212