Skip to content

Commit a23de03

Browse files
committed
Fix rename box heights in dp mode
1 parent 0dc54c8 commit a23de03

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

topasgraphsim/src/classes/main_viewer.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,7 @@ def show_preview(self):
550550
self.canvas.itemconfig(self.image_on_canvas, image=self.canvas.image)
551551

552552
for i in range(len(self.DoseFigureHandler.plots)):
553+
factor = (self.canvas.image.width() / self.canvas.image.height()) / 2
553554
temp = self.canvas.create_rectangle(
554555
(
555556
-0.00833
@@ -562,9 +563,9 @@ def show_preview(self):
562563
+ 0.94633
563564
)
564565
* self.canvas.image.width(),
565-
(0.023 + 0.042 * i) * self.canvas.image.height(),
566+
(0.023 + 0.042 * i) * self.canvas.image.height() * factor,
566567
0.988 * self.canvas.image.width(),
567-
(0.065 + 0.042 * i) * self.canvas.image.height(),
568+
(0.065 + 0.042 * i) * self.canvas.image.height() * factor,
568569
fill="",
569570
outline="",
570571
)
@@ -630,6 +631,7 @@ def handle_configure(self, event):
630631
x = self.canvas.image.width()
631632
y = self.canvas.image.height()
632633
self.canvas.delete(temp[i])
634+
factor = (self.canvas.image.width() / self.canvas.image.height()) / 2
633635
self.rename_boxes += [
634636
self.canvas.create_rectangle(
635637
(
@@ -646,9 +648,9 @@ def handle_configure(self, event):
646648
+ 0.94633
647649
)
648650
* x,
649-
(0.023 + 0.042 * i) * y,
651+
(0.023 + 0.042 * i) * y * factor,
650652
0.988 * x,
651-
(0.065 + 0.042 * i) * y,
653+
(0.065 + 0.042 * i) * y * factor,
652654
fill="",
653655
outline="",
654656
tags="rename",

topasgraphsim/src/resources/profile.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"markersize": 0.8,
55
"linewidth": 0.8,
66
"normalize": 1,
7-
"zoom": 0,
7+
"zoom": 1,
88
"fullscreen": false,
9-
"halfview": false
9+
"halfview": true
1010
}

0 commit comments

Comments
 (0)