User Tools

Site Tools


caching:ex1

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
caching:ex1 [2007/02/26 18:24] – bdefraincaching:ex1 [2021/02/05 13:51] (current) – external edit 127.0.0.1
Line 1: Line 1:
-====== Caching: Constant Override ======+[[caching:intro|Intro]] 
 +[[caching:ex1|Ex1]] 
 +[[caching:ex2|Ex2]] 
 +[[caching:ex3|Ex3]] 
 +[[caching:ex4|Ex4]]====== Caching: Constant Override ======
  
 **Task:** Pass ''tests.BoundsConstant''. **Task:** Pass ''tests.BoundsConstant''.
  
-The ''getBounds()'' method of a ''Group'' could be understood to be a conservative approximation of the bounding box of a group. If that is true, then it would be a legal (and much faster) implementation of ''getBounds()'' to simply always return a rectangle consisting of the entire canvas. The entire canvas is returned by the static member ''FigureElement.MAX_BOUNDS''. Write an aspect to implement this change.+A first, very crude approximation of the bounding box, would be to return the entire drawing canvas. This is certainly very fast to calculate (it is a constant value), although it might mean excessive redrawing. 
 + 
 +Implement an aspect to return the entire canves when the ''getBounds()'' method of a ''Group'' is invoked. The entire canvas can be retrieved through the static field ''MAX_BOUNDS'' of ''FigureElement''.
  
 <note tip> <note tip>
caching/ex1.1172510666.txt.gz · Last modified: by bdefrain