FontBureau / fbOpenTools

Some tools for working with UFOs in RoboFont.
79 stars 26 forks source link

Show Mouse Coordinates keeps firing "draw event" #8

Closed impallari closed 1 month ago

impallari commented 10 years ago

The ShowMouseCoordinates plugin activates the "draw" event with all mouse movements. This conflicts with other plugins using observers, since the event keeps firing up like crazy.

FontBureau commented 10 years ago

Hi Pablo, Sorry for my ignorance: you are saying ShowMouseCoordinates calls the draw event even though there is no draw() or drawInactive() method?

What other plugin is giving you the conflict? I'm able to run this fine alongside OverlayUFOs, for example, without a major impact on performance.

Do you know of a way to have observers for mouseMoved, mouseDragged, etc. without calling the draw event?

impallari commented 10 years ago

Hi, I'm not sure I can describe the issue with my basic auto-translated English. Let's try with a quick screen cast:

http://quick.as/y0nlhaqg ShowMouseCoordinates is OFF: Note that the draw event is only detected when it makes sense. For example when you select some nodes, or when you moves nodes around.

http://quick.as/gqvyiwbj ShowMouseCoordinates is ON: Now, note that the draw event keeps firing up like crazy with every mouse movement, even outside the glyph windows. This makes no sense, and makes the code attached to the draw observer to keep looping for ever.

I'm using a custom script here, but the same will happen to any other plugin that observes the draw event and attaches code to it.

FontBureau commented 10 years ago

Yes, I see the issue, thanks. I will ask Frederik if there is a way to update the text field with mouse coordinates without calling the draw event.

typemytype commented 10 years ago

nice script!

it happens that the added view also sends draw instructions to the underlaying views (like the glyph view)

I guess the best thing is to wait a bit until the next public update and add the view to the toolbar while opening a glyph window.

a small preview what could be done: screen shot 2014-07-24 at 00 54 55

thanks