The constructor.
The drawing context.
drawutils
Private
_fragPrivate
_programPrivate
_vertPrivate
_zindexPrivate
curPrivate
glutilsReadonly
offsetPrivate
renderReadonly
scalePrivate
vertex_Static
Private
fragStatic
Private
vertDraw a circle with the specified (CSS-) color and radius.
Note that if the x- and y- scales are different the result will be an ellipse rather than a circle.
The center of the circle.
The radius of the circle.
The CSS color to draw the circle with.
Optional
lineWidth: number(optional) The line width to use; default is 1.
circle
drawutils
Draw a circular arc (section of a circle) with the given CSS color.
The center of the circle.
The radius of the circle.
The angle to start at.
The angle to end at.
The CSS color to draw the circle with.
Optional
lineWidth: numbercircleArc
drawutils
Draw a circle handle with the given CSS color.
It is an inherent featur of the handle functions that the drawn elements are not scaled and not
distorted. So even if the user zooms in or changes the aspect ratio, the handles will be drawn
as even shaped circles.
The center of the circle.
The CSS color to draw the circle with.
circleHandle
drawutils
Creates a 'shallow' (non deep) copy of this instance. This implies that under the hood the same gl context and gl program will be used.
Draw a cross with diagonal axes with given radius, color and lineWidth at the given position.
Note that the x's radius will not be affected by scaling.
The center of the crosshair.
The radius of the crosshair.
The CSS color to draw the crosshair with.
Optional
lineWidth: number(optional, default=1.0) The line width to use.
crosshair
drawutils
Draw a crosshair with given radius and color at the given position.
Note that the crosshair radius will not be affected by scaling.
The center of the crosshair.
The radius of the crosshair.
The CSS color to draw the crosshair with.
Optional
lineWidth: number(optional, default=0.5) The line width to use.
crosshair
drawutils
Draw the given (cubic) bézier curve.
The start point of the cubic Bézier curve
The end point the cubic Bézier curve.
The start control point the cubic Bézier curve.
The end control point the cubic Bézier curve.
The CSS color to draw the curve with.
Optional
lineWidth: number(optional) The line width to use; default is 1.
cubicBezier
drawutils
Draw a cubic Bézier curve and and an arrow at the end (endControlPoint) of the given line width the specified (CSS-) color and arrow size.
The start point of the cubic Bézier curve
The end point the cubic Bézier curve.
The start control point the cubic Bézier curve.
The end control point the cubic Bézier curve.
The CSS color to draw the curve with.
Optional
lineWidth: number(optional) The line width to use.
Optional
headLength: number(optional) The length of the arrow head (default is 8 units).
cubicBezierArrow
DrawLib
Draw the given (cubic) Bézier path.
The given path must be an array with n*3+1 vertices, where n is the number of curves in the path:
[ point1, point1_startControl, point2_endControl, point2, point2_startControl, point3_endControl, point3, ... pointN_endControl, pointN ]
The cubic bezier path as described above.
The CSS colot to draw the path with.
Optional
lineWidth: number(optional) The line width to use; default is 1.
cubicBezierPath
drawutils
Draw a diamond handle (square rotated by 45°) with the given CSS color.
It is an inherent featur of the handle functions that the drawn elements are not scaled and not distorted. So even if the user zooms in or changes the aspect ratio, the handles will be drawn as even shaped diamonds.
The center of the diamond.
The x/y-size of the diamond.
The CSS color to draw the diamond with.
diamondHandle
drawutils
Draw a 1x1 dot with the specified (CSS-) color.
The position to draw the dot at.
The CSS color to draw the dot with.
dot
drawutils
Draw an ellipse with the specified (CSS-) color and thw two radii.
The center of the ellipse.
The radius of the ellipse.
The radius of the ellipse.
The CSS color to draw the ellipse with.
Optional
lineWidth: number(optional) The line width to use; default is 1.
Optional
rotation: number(optional, default=0) The rotation of the ellipse.
ellipse
drawutils
Draw a grid of horizontal and vertical lines with the given (CSS-) color.
The center of the grid.
The total width of the grid (width/2 each to the left and to the right).
The total height of the grid (height/2 each to the top and to the bottom).
The horizontal grid size.
The vertical grid size.
The CSS color to draw the grid with.
grid
drawutils
Draw an image at the given position with the given size.
Note: SVG images may have resizing issues at the moment.Draw a line and an arrow at the end (zB) of the given line with the specified (CSS-) color.
image
drawutils
Draw a non-scaling text label at the given position.
The text to draw.
The x-position to draw the text at.
The y-position to draw the text at.
Optional
rotation: numberThe (aoptional) rotation in radians.
Optional
color: stringThe color to use (default is black).
label
drawutils
Draw an SVG-like path given by the specified path data.
An array of path commands and params.
Optional
color: string(optional) The color to draw this path with (default is null).
Optional
lineWidth: number(optional) the line width to use (default is 1).
Optional
options: { Optional
inplace?: boolean(optional) If set to true then path transforamtions (scale and translate) will be done in-place in the array. This can boost the performance.
An instance representing the drawn path.
path
drawutils
Draw the given point with the specified (CSS-) color and radius 3.
The position to draw the point at.
The CSS color to draw the point with.
point
drawutils
Draw a polygon.
The polygon to draw.
The CSS color to draw the polygon with.
Optional
lineWidth: numberpolygon
drawutils
Draw a polygon line (alternative function to the polygon).
The polygon vertices to draw.
If true the polyline will not be closed at its end.
The CSS color to draw the polygon with.
Optional
lineWidth: number(optional) The line width to use; default is 1.
polyline
drawutils
Draw a raster of crosshairs in the given grid.
This works analogue to the grid() function
The center of the raster.
The total width of the raster (width/2 each to the left and to the right).
The total height of the raster (height/2 each to the top and to the bottom).
The horizontal raster size.
The vertical raster size.
The CSS color to draw the raster with.
raster
drawutils
Draw a rectangle.
The upper left corner of the rectangle.
The width of the rectangle.
The height of the rectangle.
The color to use.
Optional
lineWidth: number(optional) The line with to use (default is 1).
Set the current drawlib configuration.
The new configuration settings to use for the next render methods.
setConfiguration
Draw square at the given center, size and with the specified (CSS-) color.
Note that if the x-scale and the y-scale are different the result will be a rectangle rather than a square.
The center of the square.
The size of the square.
The CSS color to draw the square with.
Optional
lineWidth: number(optional) The line width to use; default is 1.
square
drawutils
Draw a square handle with the given CSS color.
It is an inherent featur of the handle functions that the drawn elements are not scaled and not
distorted. So even if the user zooms in or changes the aspect ratio, the handles will be drawn
as even shaped squares.
The center of the square.
The x/y-size of the square.
The CSS color to draw the square with.
squareHandle
drawutils
Draw a text at the given relative position.
The text to draw.
The x-position to draw the text at.
The y-position to draw the text at.
Optional
options: { Optional
color?: stringThe Color to use.
Optional
fontThe font family to use.
Optional
fontThe font size (in pixels) to use.
Optional
fontThe font style to use.
Optional
fontThe font weight to use.
Optional
lineThe line height (in pixels) to use.
Optional
rotation?: numberThe (optional) rotation in radians.
Optional
textThe text align to use. According to the specifiactions (https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/textAlign) valid values are "left" || "right" || "center" || "start" || "end"
.
text
drawutils
Draw an image at the given position with the given size.
Note: SVG images may have resizing issues at the moment.Draw a line and an arrow at the end (zB) of the given line with the specified (CSS-) color.
The image object to draw.
The texture size to use; these are the original bounds to map the polygon vertices to.
The polygon to use as clip path.
The polygon's position (relative), measured at the bounding box's center.
The rotation to use for the polygon (and for the texture).
texturedPoly
drawutilsgl
Classdesc
A wrapper class for basic drawing operations. This is the WebGL implementation whih sould work with shaders.
Requires
CubicBzierCurvce
Requires
Polygon
Requires
SVGSerializable
Requires
Vertex
Requires
XYCoords