Home :: GUI :: Shapes

  1. Introduction
  2. Reference
    1. Methods
      1. constructor
      2. init
      3. realize
      4. refresh
      5. registerHandles
      6. unregisterHandles
      7. selectHandles
      8. showHandles
      9. getIntersectionParams
    2. Properties
      1. p1
      2. p2
  3. Example
  4. Download

Introduction

Rectangle is a JavaScript object that allows you to interactively manipulate a rectangle via handle objects: two corner handles and a center handle. This code is used in the 2D Geometry section of this site.

Rectangle is a sub-class of the Shape class.


Reference

Methods

constructor - new Rectangle(svgNode);

This method creates a new Rectangle object. All initialization is handled by the init() method. All parameters for this method are described below.

init(svgNode);

realize();

refresh();

registerHandles();

unregisterHandles();

selectHandles();

showHandles();

getIntersectionParams() : IntersectionParams;

Properties


Example

This example allows you to adjust the rectangles within the SVG document. Here is a brief summary of the editing procedures:


Download

Rectangle.js - the rectangle object only...cannot be used in isolation

2D.js.gz - all objects needed to use this object and other 2D geometry objects