bug (annoyance) and fix in DraggableAnnotation.finalize_offset()

Ran into a bug this morning with draggable annotations. It would seem that
finalize_offset() forcibly overrides the annotation's textcoords status to
"axes fraction" so it can set the coordinates properly. That's all well
and good, but if you were using some text coordinates system other than
"axes fraction" (say, for example, "data"), this can cause fun side
effects such as annotations that used to pan around with the rest of the
graph suddenly being frozen in place. :frowning:

Attached is a patch to restore the old textcoords mode in
finalize_offset(). All it does is save the old textcoords mode before
making the change to "axes fraction" and restores it afterwards.

Hope this helps!
-jo

DraggableAnnotationDoesntOverrideTextcoords.diff (609 Bytes)

Šand this afternoon, shortly after I sent this email, my test cases for
this approach abruptly stopped functioning. Whoops. So y'all may want to
hold off on this.
(I thought it looked too easyŠ)

Been that kind of day. :slight_smile:
-jo

···

On 7/2/13 11:57 AM, "Valentine Cooper, Jo" <Jo.ValentineCooper@...4393...> wrote:

Ran into a bug this morning with draggable annotations. It would seem that
finalize_offset() forcibly overrides the annotation's textcoords status to
"axes fraction" so it can set the coordinates properly. That's all well
and good, but if you were using some text coordinates system other than
"axes fraction" (say, for example, "data"), this can cause fun side
effects such as annotations that used to pan around with the rest of the
graph suddenly being frozen in place. :frowning:

Attached is a patch to restore the old textcoords mode in
finalize_offset(). All it does is save the old textcoords mode before
making the change to "axes fraction" and restores it afterwards.

Hope this helps!
-jo