Skip to content

Commit f98313f

Browse files
committed
fix issue preventing Stats Summary from showing if language is not set to English
1 parent e427166 commit f98313f

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/artisanlib/main.py

+10-8
Original file line numberDiff line numberDiff line change
@@ -5753,9 +5753,9 @@ def statsSummary(self):
57535753
else:
57545754
start = 0
57555755

5756-
# position the stats summary relative to the right hand edge of the graph
5757-
# droptext_width,_,droptext_end = self.droptextBounds(start,statsheight,ls,prop,fc)
5758-
_,_,droptext_end = self.droptextBounds(start,statsheight,ls,prop,fc)
5756+
# position the stats summary relative to the right hand edge of the graph
5757+
drop_label = QApplication.translate("Scope Annotation","DROP {0}", None).replace("{0}","[0-9:]*")
5758+
_,_,droptext_end = self.droptextBounds(drop_label,start,statsheight,ls,prop,fc)
57595759
stats_textbox_bounds = self.statstextboxBounds(self.ax.get_xlim()[1]+border,statsheight,statstr,ls,prop,fc)
57605760
stats_textbox_width = stats_textbox_bounds[2]
57615761
stats_textbox_height = stats_textbox_bounds[3]
@@ -5769,8 +5769,7 @@ def statsSummary(self):
57695769
prev_stats_textbox_width = 0
57705770
#set the maximum number of iterations
57715771
for _ in range(2, 20):
5772-
# droptext_width,_,droptext_end = self.droptextBounds(start,statsheight,ls,prop,fc)
5773-
_,_,droptext_end = self.droptextBounds(start,statsheight,ls,prop,fc)
5772+
_,_,droptext_end = self.droptextBounds(drop_label,start,statsheight,ls,prop,fc)
57745773
stats_textbox_bounds = self.statstextboxBounds(self.ax.get_xlim()[1]+border,statsheight,statstr,ls,prop,fc)
57755774
stats_textbox_width = stats_textbox_bounds[2]
57765775
stats_textbox_height = stats_textbox_bounds[3]
@@ -5810,11 +5809,14 @@ def statstextboxBounds(self,x_pos,y_pos,textstr,ls,prop,fc):
58105809
return bbox.bounds
58115810

58125811

5813-
def droptextBounds(self,x_pos,y_pos,ls,prop,fc):
5814-
import re
5812+
def droptextBounds(self,drop_label,x_pos,y_pos,ls,prop,fc):
5813+
import re
5814+
droptext_width = 0
5815+
droptextstart = 0
5816+
droptext_end = 0
58155817
for child in self.ax.get_children():
58165818
if isinstance(child, mpl.text.Annotation):
5817-
droptext = re.search(r'.*\((.*?),.*(DROP [0-9:]*)',str(child))
5819+
droptext = re.search(r'.*\((.*?),.*({0})'.format(drop_label),str(child))
58185820
if droptext:
58195821
droptextstart = int(float(droptext.group(1))) - x_pos
58205822
droptext_width = self.statstextboxBounds(x_pos,y_pos,droptext.group(2),ls,prop,fc)[2]

0 commit comments

Comments
 (0)