Skip to content

Commit

Permalink
OWNomogram: Do not paint scene until the widget is open
Browse files Browse the repository at this point in the history
  • Loading branch information
VesnaT committed Apr 7, 2017
1 parent 5eb58c1 commit 9216575
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Orange/widgets/visualize/ownomogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,7 @@ def __init__(self):
self.hidden_vertical_line = None
self.old_target_class_index = self.target_class_index
self.markers_set = False
self.repaint = False

# GUI
box = gui.vBox(self.controlArea, "Target class")
Expand Down Expand Up @@ -765,6 +766,7 @@ def _cont_feature_dim_combo_changed(self):

def eventFilter(self, obj, event):
if obj is self.view.viewport() and event.type() == QEvent.Resize:
self.repaint = True
values = [item.dot.value for item in self.feature_items]
self.feature_marker_values = self.scale_back(values)
self.update_scene()
Expand Down Expand Up @@ -877,6 +879,8 @@ def calculate_log_reg_coefficients(self):
self.log_reg_cont_data_extremes.append([None])

def update_scene(self):
if not self.repaint:
return
self.clear_scene()
if self.domain is None or not len(self.points[0]):
return
Expand Down
1 change: 1 addition & 0 deletions Orange/widgets/visualize/tests/test_ownomogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def setUpClass(cls):

def setUp(self):
self.widget = self.create_widget(OWNomogram)
self.widget.repaint = True

def test_input_nb_cls(self):
"""Check naive bayes classifier on input"""
Expand Down

0 comments on commit 9216575

Please sign in to comment.