User Guide

Ruby Component
To reset the clipping region just call resetClip or you can also pass nil as the region for the setClip method.
The getClip method will return an array representing the bounding rectangle of the current clip region in the format [x,y,width,height].
Smoothing
By default all graphics are smoothed. The otherwise sharp jagged edges around graphics objects are antialiased to make them appear
smooth.
If you're drawing straight lines you may want to turn this off as a side effect is that it does introduce a little blurring. The setSmoothingMode
method of the View class allows you to control when smoothing is applied. You can pass 0 & 1 or “on” & “off”.
There is a similar method for text smoothing called setTextRenderingHint. This method has more input options:
“off” - no smoothing
“singleBitPerPixelGridFit” - use glyph bitmaps for each character with hinting
“singleBitPerPixel” - use glyph bitmaps for each character with no hinting
“antiAliasGridFit” - use antialiased glyph bitmaps for each character with hinting
“antiAlias” - use antialiased glyph bitmaps for each character with no hinting
“clearTypeGridFit” - use ClearType glyph bitmaps for each character with hinting
View Properties
There are a few more methods of the View class that we haven't mentioned yet. As well as the drawing methods we've already talked about
there are four methods that give you some important properties of the View. These are as follows:
gridStep
defaultGridStep
width
height
The gridStep method gives you the number of pixels per grid square for a view object. The defaultGridStep method gives you the default
grid step ie. the number of pixels per grid square when the zoom level is set to normal. If you don't change the default grid step (under Zoom
Level on the Schematic options dialog) then this will be 8 pixels per grid square.
These two methods are not often used but they can be useful in special circumstance eg. for scaling bitmaps as you may want a bitmap to
appear at normal size when at the default zoom level but scale accordingly when zoomed.
The width and height methods are much more commonly used. If you want your graphics to change based on the size of the front panel
you're drawing to then you'll need to know the width and height. These are of course supplied in grid square units.
Sometimes you need to be able to get the view size when you're not in the Draw method. What do you do if you don't have access to a View
object? Well we have a special method of the RubyEdit class that you can use:
127 of 212