From 4f098134b209e3b2d1af9e0e66544bb7c80d7001 Mon Sep 17 00:00:00 2001 From: Vesna Tanko Date: Tue, 31 Jan 2017 16:09:36 +0100 Subject: [PATCH] OWNomogram: Adjust scene rect --- Orange/widgets/visualize/ownomogram.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Orange/widgets/visualize/ownomogram.py b/Orange/widgets/visualize/ownomogram.py index cc05ef13d63..64c748d9c96 100644 --- a/Orange/widgets/visualize/ownomogram.py +++ b/Orange/widgets/visualize/ownomogram.py @@ -740,10 +740,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: @@ -922,10 +923,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):