API Docs for: 7.2
Show:

MQA.Graphics Class

Module: MQA

Methods

_fireDOMEvent

() private

Fire a DOM event on this shape, as if it had a corresponding DOM element that received the event.

clear

(
  • canvas
)
private

Remove all displayed graphics from our drawing surface and re-display it.

Default implementation just removes all child nodes from canvas.

Parameters:

clear

(
  • canvas
)

Remove all displayed graphics from our drawing surface and re-display it.

Parameters:

dispose

()

Dispose resources

dispose

()

Clean up

drawEllipse

(
  • canvas
  • ellipse
)

Draw the specified ellipse on canvas.

Abstract method. Actual engines must implement this.

Parameters:

  • canvas HTMLElement
    • our drawing surface.
  • ellipse Object
    • an object with a points field that is an Array of objects with x/y fields.

drawEllipse

(
  • canvas
  • ellipse
)

Draw the specified ellipse on canvas.

Parameters:

  • canvas HTMLElement
    • our drawing surface.
  • ellipse Object
    • an object with a points field that is an Array of objects with x/y fields.

drawLine

(
  • canvas
  • line
)

Draw the specified line on canvas.

Abstract method. Actual engines must implement this.

Parameters:

  • canvas HTMLElement
    • our drawing surface.
  • line Object
    • an object with a points field that is an Array of objects with x/y fields.

drawLine

(
  • canvas
  • line
)

Draw the specified line on canvas.

Parameters:

  • canvas HTMLElement
    • our drawing surface.
  • line Object
    • an object with a points field that is an Array of Objects with x/y fields.

getCanvas

(
  • width
  • height
)
HTMLElement

Create and return a DOM element to use as a drawing surface.

Abstract method. Actual engines must implement this.

Parameters:

Returns <HTMLElement>

Drawing surface.

getCanvas

(
  • width
  • height
)

Create and return a DOM element to use as a drawing surface.

Parameters:

initialize Let the engine do any one-time setup it requires. Default implementation does nothing.

()

remove

()

remove

resetTransform

()

All work is done here because each shape needs to be updated to the local coordinate system.