Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3127 adding custom text to a graph causes it to go blank #3128

Merged
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions src/sas/qtgui/Plotting/Plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,10 +531,7 @@ def onAddText(self):
# MPL style names
styles = ['normal', 'italic', 'oblique']
# QFont::Style maps directly onto the above
try:
mpl_font.set_style(styles[extra_font.style()])
except:
pass
mpl_font.set_style(styles[extra_font.style().value])

if len(extra_text) > 0:
new_text = self.ax.text(pos_x,
Expand Down Expand Up @@ -919,6 +916,11 @@ def onMplMouseDown(self, event):
"""
Left button down and ready to drag
"""
try:
self.x_click = float(event.xdata) # / size_x
self.y_click = float(event.ydata) # / size_y
except:
self.position = None
# Check that the LEFT button was pressed
if event.button != 1:
return
Expand All @@ -930,11 +932,6 @@ def onMplMouseDown(self, event):
return
if event.inaxes is None:
return
try:
self.x_click = float(event.xdata) # / size_x
self.y_click = float(event.ydata) # / size_y
except:
self.position = None

x_str = GuiUtils.formatNumber(self.x_click)
y_str = GuiUtils.formatNumber(self.y_click)
Expand Down
Loading