Packagecom.yworks.canvas
Interfacepublic interface ICanvasContext

This interface describes the context for many operations performed on items in a CanvasControl.



Public Properties
 PropertyDefined by
  hitTestRadius : Number
[read-only] The radius for hit tests and marquee selection tests in world coordinates.
ICanvasContext
  zoom : Number
[read-only] Returns the current zoom level, i.e.
ICanvasContext
Public Methods
 MethodDefined by
  
Returns the ICanvasObjects that represent the given item in the CanvasComponent or null.
ICanvasContext
  
Returns the main ICanvasObject that represents the given item in the CanvasComponent or null.
ICanvasContext
  
Creates a point that corresponds to the given point in stage coordinates.
ICanvasContext
Property detail
hitTestRadiusproperty
hitTestRadius:Number  [read-only]

The radius for hit tests and marquee selection tests in world coordinates. This value already takes the zoom level into account.

Implementation
    public function get hitTestRadius():Number
zoomproperty 
zoom:Number  [read-only]

Returns the current zoom level, i.e. the ratio of world coordinates to screen pixels.

Implementation
    public function get zoom():Number
Method detail
getCanvasObjects()method
public function getCanvasObjects(forItem:IModelItem):Array

Returns the ICanvasObjects that represent the given item in the CanvasComponent or null.

Parameters
forItem:IModelItem — The item to get the canvas objects for.

Returns
Array — The canvas objects that represent the given item.
getMainCanvasObject()method 
public function getMainCanvasObject(forItem:IModelItem):ICanvasObject

Returns the main ICanvasObject that represents the given item in the CanvasComponent or null.

Parameters
forItem:IModelItem — The item to get the canvas object for.

Returns
ICanvasObject — The main canvas object that represent the given item.
worldToStage()method 
public function worldToStage(pView:IPoint):IPoint

Creates a point that corresponds to the given point in stage coordinates.

Parameters
pView:IPoint — A point in world coordinates

Returns
IPoint — The newly created point.