Skip to content

Commit

Permalink
Added some comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescrake-merani committed Oct 18, 2024
1 parent 4534e46 commit 50bbddf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/sas/qtgui/Plotting/Plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,9 @@ def onAddText(self):
# MPL style names
styles = ['normal', 'italic', 'oblique']
# QFont::Style maps directly onto the above
mpl_font.set_style(styles[extra_font.style().value])
# Get an index of the font style which we can then lookup in the styles list.
font_index = extra_font.style().value
mpl_font.set_style(styles[font_index])

if len(extra_text) > 0:
new_text = self.ax.text(pos_x,
Expand Down Expand Up @@ -916,6 +918,8 @@ def onMplMouseDown(self, event):
"""
Left button down and ready to drag
"""
# Before checking if this mouse click is a left click, we need to update the position of the mouse regardless as
# this may be needed by other events (e.g. adding text)
try:
self.x_click = float(event.xdata) # / size_x
self.y_click = float(event.ydata) # / size_y
Expand Down

0 comments on commit 50bbddf

Please sign in to comment.