Changeset 2082

Show
Ignore:
Timestamp:
09/04/07 04:25:59 (1 year ago)
Author:
arj..@yirdis.nl
Message:

Maintain a minimal view port.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • gaphas/trunk/gaphas/view.py

    r2081 r2082  
    482482            adjustment.page_increment = viewport_size 
    483483            adjustment.step_increment = viewport_size/10 
    484             adjustment.upper = adjustment.value + canvas_offset + canvas_size + viewport_size 
    485             adjustment.lower = adjustment.value + canvas_offset - viewport_size 
     484            adjustment.upper = adjustment.value + canvas_offset + canvas_size 
     485            adjustment.lower = adjustment.value + canvas_offset 
    486486         
    487487        if adjustment.value > adjustment.upper - viewport_size: 
     
    495495        if not allocation: 
    496496            allocation = self.allocation 
    497         # Bounding box is intersected with a (0, 0) point 
    498         x, y, w, h = self.bounding_box + (self.matrix.transform_point(0, 0) + (0, 0)) 
     497 
     498        # Define a minimal view size: 
     499        aw, ah = allocation.width, allocation.height  
     500        x, y, w, h = self.bounding_box + (self.matrix.transform_point(0, 0) + (aw * 2, ah * 2)) 
    499501        self._update_adjustment(self._hadjustment, 
    500502                                value = self._hadjustment.value, 
     
    509511 
    510512        x, y, w, h = self._qtree.bounds 
    511         if w != allocation.width or h != allocation.height
    512             self._qtree.resize((0, 0, allocation.width, allocation.height)) 
     513        if w != aw or h != ah
     514            self._qtree.resize((0, 0, aw, ah)) 
    513515         
    514516