Every vector graphics window requires an elaborated mechanism to align objects.
The ideal mechanism would consist of interactive Help lines denoting angle and equidistance to other objects. These functionality is, due to technical limitations, not yet possible for canvas or TkZinc 3.3.4. Consequently, Help lines have to fill the gap.
Jeszra provides two different types of Help lines in drawing windows: The normal –including active– and »embedded Help lines«. The light blue lines in Figure 3.5, “The different Help lines Types” are either dynamic or normal Help lines; red lines are embedded Help lines. Snop-to-line only works for the light-blue Help lines.
Embedded Help lines move together with a graphical object. This behavior is modifiable, but currently not through Jeszra’s Graphical User Interface.
In total: there are three Help lines types provided by Jeszra: Dynamic, normal and embedded Help lines.
Supported drawing windows are: Tk canvas, pathCanvas – the successor to canvas and TkPath– and TkZinc 3.3.4.
Embedded Help lines are somewhat differently displayed across various drawing windows. Under TkZinc 3.3.4, embedded Help lines are doubled; this is required under AQUA®.
Snap to Help lines is also active during object creation. Use it to properly align coordinates of multi-point objects –such as TkPath path. While clicking sufficiently close to a Help Line the new coordinate point is moved directly onto that line.
Normal Help lines are placed inside the drawing window. The position, of these Help lines is related to the window coordinates. They are not affected by scrolling or the dimension of the »scrollregion«.
Create Help lines through the context menu entries »X & Y Help lines«, or the Help Line Editor, available from the »Extra« menu under Figure 3.9, “Customize Help lines”.
You may also use the Shell to create Help lines. Open the »Shell« from the »Extra« Menu, switch to the »Local:« project –by entering the key-sequence : +,- and Enter. The prompt »Local:« will appear – indicating that the Shell operates on the project. Use hline::insert to insert Help lines
Example 3.1. Insert Help lines
# 'w' points to the selected window. set w .top_1.canvas_1 ;# The drawing window. # Insert an 'x' divider at point 10,10 hline::insert x $w 10 10 # Insert an 'y' divider at point 30,30 hline::insert y $w 30 30
Embedded Help lines are one pixel width, red lines embedded inside the scrolling area of a drawing window.
Embedded Help lines are dotted red lines under TkZinc 3.3.4 for AQUA®.
Embedded Help lines are only available for TkZinc 3.3.4 and canvas windows. An embedded Help Line resides inside the drawing area and partakes with scrolling operations and thus may vanish from view.
Embedded Help lines do not snap. That is no auto alignment can be performed with this type of drawing aid.
Embedded Help lines takes part in the movement of a graphical object. This way, aligning objects can be emulated with embedded Help lines –or through a combination of embedded and normal Help lines.
Insert embedded Help lines from the context menu. The Help lines editor can’t be used for embedded Help lines.
Through the Shell, you can also control embedded Help lines.
Example 3.2. Inserting Embedded Help lines
Local: hline::insert x $w 10 10 1 ;# the final '1' tells ;# insert that this is an ;# embedded Help Line.
Snap can be activated for embedded Help lines, too.
This is, however, only available from the Shell.
The behavior is controlled by the variable:
::rat(grip,fix,Invisible)
. Setting this
variable to »1« (true), disables the interactive movement
for embedded Help lines, and lets the object snap to
them.
A dedicated Help lines editor, for embedded
Help lines, is under construction. These editor
can be activated from the »Jeszra:« prompt with
Jeszra: .gestalt embeddedHelplines
.
Grid points are newly introduced with Jeszra version 0.2.
Grid points allow for better adjustment in a larger drawing area, without flooding the entire area with lines. Therefore more of the drawing area remains visible.
Grid points are inert.
Either define grid points through the Shell or the context menu.
Example 3.4. Create Grid Points
# In the shell. Jeszra:+- # The canvas window must be selected. Local: grip::displayGrid $w 15m 15m; # Create a 15mm x 15mm grid Local: grip::displayGrid $w 48p 24p; # Create a 48point x 24point grid