Changeset 8282:22d011e73278 in orange


Ignore:
Timestamp:
05/28/11 20:39:46 (3 years ago)
Author:
Noughmad <Noughmad@…>
Branch:
default
Convert:
56635a506b6f7848c3c4f1f7c5f8984e65f2ffde
Message:

Small optimization for drawing points, still slow with large data

Location:
orange/OrangeWidgets
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeWidgets/Graph/curve.py

    r8281 r8282  
    5151            s = self.style.point_size 
    5252            shape = self.style.point_shape 
     53            self.point_items = [] 
    5354            for p in self.data: 
    5455                (x, y) = self.graph.map_to_graph(p) 
     
    5758                elif shape is SquareShape: 
    5859                    i = QGraphicsRectItem(x-s/2, y-s/2, s, s, self) 
    59                 i.setPen(self.style.pen()) 
    60                 i.setBrush(self.style.brush()) 
     60                self.point_items.append(i) 
     61            p = self.style.pen() 
     62            map((lambda i: i.setPen(p)), self.point_items) 
     63            b = self.style.brush() 
     64            map((lambda i: i.setBrush(b)), self.point_items) 
    6165         
  • orange/OrangeWidgets/QtGraph.py

    r8281 r8282  
    128128        min_x, max_x = self.data_range[axes[0]] 
    129129        min_y, max_y = self.data_range[axes[1]] 
    130         rect = self.graph_area_rect() 
     130        rect = self.graph_area 
    131131        rx = (px - min_x) * rect.width() / (max_x - min_x) 
    132132        ry = -(py - min_y) * rect.height() / (max_y - min_y) 
Note: See TracChangeset for help on using the changeset viewer.