nengo-gui icon indicating copy to clipboard operation
nengo-gui copied to clipboard

Borders of components flicker on resize

Open cchan987 opened this issue 9 years ago • 6 comments

cchan987 avatar Jul 06 '15 15:07 cchan987

This seems to happen primarily on slower computers (I never noticed it on my Macbook). It appears that the corner does not stay fixed under the mouse pointer. I believe (but might be wrong), that the resize amount is calculated from the relative movement of the mouse (which seems to be either inaccurate or some resize events are missed because the processing is too slow). It might be better to calculate the size based on the absolute mouse coordinates which should always be accurate (fixed aspect ratio elements do it that way). But I am not completely sure that this will elimate all flicker ...

jgosmann avatar Jul 06 '15 16:07 jgosmann

Yup, looks to me that it's about the mouse cursor being outside the component, so it's no longer triggering the hover. But it happens on my desktop machine, so it's not about the speed of the computer for me.

I'd say the solution is just to have a "dragging" class that's set during the drag, and use that to set the look rather than the graph:hover thing.

tcstewar avatar Jul 06 '15 17:07 tcstewar

I would like to have this re-verified to see that this is actually happening to see if is was a bug with browser or a bug with the code. I am on a Mac so if anyone on a windows computer can double check again I would appreciate it.

krisfrenette avatar Apr 30 '19 16:04 krisfrenette

Does happen on my Mac with Firefox. Not sure whether it is exactly the same issue because I don't think it happens due to performance (though this would correspond to @tcstewar's comment). For specific cursor positions I could make the border disappear for as long as I held the mouse still just now. Might be something that only occurs on high DPI displays due to fractional pixel values.

jgosmann avatar Apr 30 '19 17:04 jgosmann

For some resize operations it is not happening at all, but if it is flickering in one resize operation it is reliable and it is quite easy to find mouse positions where the border stays hidden. I was also able to produce minimal mouse (or actual track pad) movements where the mouse cursor would not move, but the component/graph would shrink by one pixel and lose the border (presumably because it is no longer in hover state than). Seems like some sort of rounding problem in the size calculation.

jgosmann avatar Apr 30 '19 17:04 jgosmann

Perfect, thanks for adding

krisfrenette avatar Apr 30 '19 17:04 krisfrenette