Skip to content

Commit

Permalink
Merge pull request #1982 from VesnaT/nomogram_scene_resize
Browse files Browse the repository at this point in the history
[FIX] OWNomogram: Adjust scene rect
  • Loading branch information
lanzagar authored Feb 2, 2017
2 parents ed69cd5 + 4f09813 commit d8f221a
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions Orange/widgets/visualize/ownomogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -745,10 +745,11 @@ def __hide_attrs(self, n_show):
y = self.nomogram_main.layout.preferredHeight() + 30
self.vertical_line.setLine(x, -6, x, y)
self.hidden_vertical_line.setLine(x, -6, x, y)
self.scene.setSceneRect(QRectF(self.scene.sceneRect().x(),
self.scene.sceneRect().y(),
self.scene.itemsBoundingRect().width(),
self.nomogram.preferredSize().height()))
rect = QRectF(self.scene.sceneRect().x(),
self.scene.sceneRect().y(),
self.scene.itemsBoundingRect().width(),
self.nomogram.preferredSize().height())
self.scene.setSceneRect(rect.adjusted(0, 0, 70, 70))

def _sort_combo_changed(self):
if self.nomogram_main is None:
Expand Down Expand Up @@ -928,10 +929,11 @@ def update_scene(self):
nomogram.add_items([nomogram_head, self.nomogram_main, nomogram_foot])
self.scene.addItem(nomogram)
self.set_feature_marker_values()
self.scene.setSceneRect(QRectF(self.scene.itemsBoundingRect().x(),
self.scene.itemsBoundingRect().y(),
self.scene.itemsBoundingRect().width(),
self.nomogram.preferredSize().height()))
rect = QRectF(self.scene.itemsBoundingRect().x(),
self.scene.itemsBoundingRect().y(),
self.scene.itemsBoundingRect().width(),
self.nomogram.preferredSize().height())
self.scene.setSceneRect(rect.adjusted(0, 0, 70, 70))

def create_main_nomogram(self, name_items, points, max_width, point_text,
name_offset):
Expand Down

0 comments on commit d8f221a

Please sign in to comment.