| Package | com.yworks.canvas.drawing |
| Class | public class GridSnapResultPaintable |
| Inheritance | GridSnapResultPaintable Object |
| Implements | IPaintable |
snappedGridPoint as well as at all eight grid points around it using
horizontalSpacing and verticalSpacing of the gridInfo to determine their position.
If the spacing in view coordinates between the snappedGridPoint and any of these grid points is
smaller then the minimumSpacing, a grid point further away from the snappedGridPoint
is used instead to fulfill the minimumSpacing.
This way the snap result visualization adapts to the current zoom level but does place it's painted points only
on grid coordinates.
See also
| Property | Defined By | ||
|---|---|---|---|
| gridInfo : GridInfo
The grid info containing the horizontal and vertical grid spacing. | GridSnapResultPaintable | ||
| minimumSpacing : Number
The minimum spacing of the painted grid points around the snappedGridPoint in view coordinates . | GridSnapResultPaintable | ||
| snappedGridPoint : IPoint
The grid point the moved object has snapped to. | GridSnapResultPaintable | ||
| stroke : IStroke
The stroke used in the paint method. | GridSnapResultPaintable | ||
| Method | Defined By | ||
|---|---|---|---|
Paints '+' symbols at the snappedGridPoint as well as at all eight grid points around it using
horizontalGridWidth and verticalGridWidth to determine their position. | GridSnapResultPaintable | ||
Paints a '+' symbol at the given x and y coordinates stretching size
long to each side. | GridSnapResultPaintable | ||
| gridInfo | property |
gridInfo:GridInfoThe grid info containing the horizontal and vertical grid spacing.
public function get gridInfo():GridInfo public function set gridInfo(value:GridInfo):void| minimumSpacing | property |
minimumSpacing:Number
The minimum spacing of the painted grid points around the snappedGridPoint in view coordinates .
The default value is 40.
public function get minimumSpacing():Number public function set minimumSpacing(value:Number):voidSee also
| snappedGridPoint | property |
snappedGridPoint:IPointThe grid point the moved object has snapped to.
public function get snappedGridPoint():IPoint public function set snappedGridPoint(value:IPoint):void| stroke | property |
stroke:IStroke
The stroke used in the paint method.
public function get stroke():IStroke public function set stroke(value:IStroke):voidSee also
| paint | () | method |
public function paint(g:YGraphics, ctx:IPaintContext):void
Paints '+' symbols at the snappedGridPoint as well as at all eight grid points around it using
horizontalGridWidth and verticalGridWidth to determine their position.
It delegates to paintGridPoint to paint each of these grid points.
Parameters
g:YGraphics — The graphics object to paint upon.
| |
ctx:IPaintContext — The paint context.
|
See also
| paintGridPoint | () | method |
public function paintGridPoint(g:YGraphics, ctx:IPaintContext, x:Number, y:Number, size:Number = 4):void
Paints a '+' symbol at the given x and y coordinates stretching size
long to each side.
Parameters
g:YGraphics — The graphics object to paint upon.
| |
ctx:IPaintContext — The paint context.
| |
x:Number — The horizontal position of the center of the plus sign.
| |
y:Number — The vertical position of the center of the plus sign.
| |
size:Number (default = 4) — The size the plus sign stretches to each side.
|