3 #A point in pixel coordinates
\r
4 class GPoint < Struct.new(:x,:y)
\r
5 include MappingObject
\r
7 "new GPoint(#{x},#{y})"
\r
10 #A rectangular that contains all the pixel points passed as arguments
\r
12 include MappingObject
\r
13 attr_accessor :points
\r
14 #Accepts both an array of GPoint and an array of 2-element arrays
\r
15 def initialize(points)
\r
16 if !points.empty? and points[0].is_a?(Array)
\r
17 @points = points.collect { |pt| GPoint.new(pt[0],pt[1]) }
\r
23 "new GBounds([#{@points.map { |pt| pt.to_javascript}.join(",")}])"
\r
26 #A size object, in pixel space
\r
27 class GSize < Struct.new(:width,:height)
\r
28 include MappingObject
\r
30 "new GSize(#{width},#{height})"
\r