Skip to content

Commit

Permalink
Add background to onscreen message
Browse files Browse the repository at this point in the history
  • Loading branch information
ejeschke committed Oct 18, 2024
1 parent 6e299f3 commit 4aecd68
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
9 changes: 6 additions & 3 deletions ginga/ImageView.py
Original file line number Diff line number Diff line change
Expand Up @@ -3641,21 +3641,24 @@ def set_onscreen_message(self, text, redraw=True):
message = canvas.get_object_by_tag(tag)
if text is None:
message.text = ''
message.bgalpha = 0.0
else:
message.x = x
message.y = y
message.text = text
message.fontsize = font_size
message.bgalpha = 1.0

except KeyError:
if text is None:
text = ''
Text = canvas.get_draw_class('text')
canvas.add(Text(x, y, text=text,
font=font, fontsize=font_size,
#color='black', alpha=1.0, linewidth=1,
fill=True,
fillcolor=self.img_fg, fillalpha=1.0,
#color='black', alpha=0.0, linewidth=0,
fill=True, fillcolor=self.img_fg, fillalpha=1.0,
bgcolor='black', bgalpha=1.0,
borderlinewidth=0,
coord='window'),
tag=tag, redraw=False)

Expand Down
6 changes: 4 additions & 2 deletions ginga/gw/PlotView.py
Original file line number Diff line number Diff line change
Expand Up @@ -982,10 +982,12 @@ def plot_do_pan(self, cb_obj, event):
"""Can be set as the callback function for the 'button-press'
event to pan the plot with middle-click.
"""
if event.button == 0x2:
cur_x, cur_y = event.data_x, event.data_y

if event.button == 0x2 or (event.button == 0x1 and
'shift' in event.modifiers):
if not self.can.pan:
return
cur_x, cur_y = event.data_x, event.data_y
if None not in [cur_x, cur_y]:
self.set_pan(cur_x, cur_y)

Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ setup_requires = setuptools_scm
[options.extras_require]
recommended =
scipy>=0.18.1
matplotlib>=3.4
opencv-python>=4.5.4.58
matplotlib>=3.8
opencv-python-headless>=4.5.4.58
exifread>=2.3.2
astroquery>=0.3.5
python-dateutil>=2.8.2
Expand Down

0 comments on commit 4aecd68

Please sign in to comment.