Skip to content

Commit

Permalink
Fix #97
Browse files Browse the repository at this point in the history
  • Loading branch information
pllim committed Mar 3, 2016
1 parent ed3ecbe commit 97fe204
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions stginga/plugins/MIPick.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
# LOCAL
from stginga.plugins.MultiImage import Region

__all__ = []


class MIPick(Pick):
"""This is like ``Pick`` plugin but modified to work with ``MultiImage``
Expand All @@ -19,6 +21,10 @@ def __init__(self, fv, fitsimage):
# superclass defines some variables for us, like logger
super(MIPick, self).__init__(fv, fitsimage)

# Override parent attributes
self.layertag = 'mipick-canvas'
self._textlabel = 'MIPick'

# Additional attributes
self.multiimage_name = 'MultiImage'
self.region = None
Expand Down Expand Up @@ -101,7 +107,7 @@ def redo(self):
self.wdetail.sample_area.set_text('%dx%d' % (x2 - x1, y2 - y1))

point.color = 'red'
text.text = 'Pick: calc'
text.text = '{0}: calc'.format(self._textlabel)
self.pickcenter.x = xc
self.pickcenter.y = yc
self.pickcenter.color = 'red'
Expand Down Expand Up @@ -214,7 +220,8 @@ def draw_compound(self, obj, canvas, *args):
tag = canvas.add(self.dc.CompoundObject(
self.dc.Rectangle(x1, y1, x2, y2, color=self.pickcolor),
self.dc.Point(x, y, 10, color='red'),
self.dc.Text(x1, y2 + 4, "Pick: calc", color=self.pickcolor)))
self.dc.Text(x1, y2 + 4, '{0}: calc'.format(self._textlabel),
color=self.pickcolor)))
self.picktag = tag
self.region.set_bbox(x1, y1, x2, y2, coord='data')

Expand Down

0 comments on commit 97fe204

Please sign in to comment.