diff options
author | pmoxhay <pmoxhay@earthlink.net> | 2009-05-21 11:34:12 (GMT) |
---|---|---|
committer | pmoxhay <pmoxhay@earthlink.net> | 2009-05-21 11:34:12 (GMT) |
commit | 9f52a7ce71a89ffab1762348741699a34a0c16d2 (patch) | |
tree | 64642cf5b262eee8ce0437d5ae871e4a4865795a | |
parent | 37b8913eff69c1eb3a2d0cd2770c9b2414d7c777 (diff) |
Improved appearance of model object for amount comparisons.
-rw-r--r-- | TODO | 1 | ||||
-rw-r--r-- | compare3lesson.py | 2 | ||||
-rw-r--r-- | modelobject.py | 21 | ||||
-rw-r--r-- | shapeobject.py | 1 |
4 files changed, 16 insertions, 9 deletions
@@ -20,4 +20,5 @@ Compare3 Lesson + Volume comparison: fit into answer box. + Amount comparison: fit into answer box (maybe make wider and reposition). + Amount comparison: refine appearance of object groups. +- Amount comparison: refine appearance of model (make pagelike). diff --git a/compare3lesson.py b/compare3lesson.py index 1e85cd5..602bc29 100644 --- a/compare3lesson.py +++ b/compare3lesson.py @@ -85,7 +85,7 @@ class Compare3Lesson(ObjectArea): self.problem_type = random.choice(PROBLEM_TYPES) # Uncomment this to choose a particular problem type. - #self.problem_type = 'volume' + #self.problem_type = 'amount' if self.problem_type == 'length': self.problem = LengthProblem(self) diff --git a/modelobject.py b/modelobject.py index 394542c..d88cba6 100644 --- a/modelobject.py +++ b/modelobject.py @@ -15,11 +15,13 @@ # along with Math. If not, see <http://www.gnu.org/licenses/>.
from vector import Vector
-import gtk, math
+import gtk, math, rsvg
from objectarea import Object
from vector import Vector
+PAGE_SVG = rsvg.Handle('page.svg')
+
# Class containing various standard colors. Each color is a 3 element tuple.
class Color:
BLUE = (0.25, 0.25, 0.75)
@@ -38,13 +40,16 @@ class ModelObject(Object): self.container = container
def draw(self, cr):
- cr.rectangle(self.pos.x, self.pos.y, self.size.x, self.size.y)
- cr.set_source_rgb(0.78, 0.70, 0.60)
-
- cr.fill_preserve()
- cr.set_source_rgb(0, 0, 0)
- cr.set_line_width(1.0)
- cr.stroke()
+ #cr.rectangle(self.pos.x, self.pos.y, self.size.x, self.size.y)
+ #cr.set_source_rgb(0.78, 0.70, 0.60)
+ #
+ #cr.fill_preserve()
+ #cr.set_source_rgb(0, 0, 0)
+ #cr.set_line_width(1.0)
+ #cr.stroke()
+
+ cr.translate(self.pos.x - 1, self.pos.y - 1)
+ PAGE_SVG.render_cairo(cr)
diff --git a/shapeobject.py b/shapeobject.py index cdd5091..2f3eb81 100644 --- a/shapeobject.py +++ b/shapeobject.py @@ -85,6 +85,7 @@ class ShapeObject(MovableObject): self.bounds_max += Vector(2, 2)
def get_bounds(self):
+ print "ShapeObject get_bounds: ", self.bounds_min, self.bounds_max
return self.bounds_min, self.bounds_max
def transform_point(self, p):
|