pixi-viewport icon indicating copy to clipboard operation
pixi-viewport copied to clipboard

Mouse edge distance fix

Open kurtwaldowski-echelon opened this issue 3 years ago • 7 comments

The wrong variable was used, causing strange behavior when using MouseEdge with distance, for Right and Bottom.

This issue was mentioned here: https://github.com/davidfig/pixi-viewport/issues/263

@davidfig

kurtwaldowski-echelon avatar Feb 08 '22 08:02 kurtwaldowski-echelon

@davidfig Anything I need to do in order to get this looked over? Thanks!

kurtwaldowski-echelon avatar Mar 04 '22 19:03 kurtwaldowski-echelon

@davidfig Anything I need to do in order to get this looked over? Thanks!

Totally need this feature in <3 GL

AjayKoenigArcurve avatar May 05 '22 16:05 AjayKoenigArcurve

👀 🙏 👀

kurtwaldowski-echelon avatar Jun 22 '22 17:06 kurtwaldowski-echelon

@davidfig I would also love to see this in! I will build a workaround now (reinitialize the plugin on resize with overwriting worldScreen* in viewport) @kurtwaldowski-echelon thank you for digging deeper into this!

ribx avatar Jul 22 '22 07:07 ribx

@AjayKoenigArcurve @kurtwaldowski-echelon :

There is a nice workaround (worldScreenX = screenX * scale):

    // workaround until https://github.com/davidfig/pixi-viewport/pull/373 is merged
    const oldScale = {x: viewport.scale.x, y: viewport.scale.y}
    viewport.scale = {x: 1, y: 1}
    viewport.plugins.get('mouse-edges')?.resize()
    viewport.scale = oldScale

ribx avatar Jul 22 '22 07:07 ribx

@ribx Thanks for the workaround, I forked but may run with this instead for now!

kurtwaldowski-echelon avatar Jul 27 '22 17:07 kurtwaldowski-echelon

@ribx Thanks for the workaround, I forked but may run with this instead for now!

Confirmed it works on my end as well, thanks for this for the time being.

kurtwaldowski-echelon avatar Aug 04 '22 18:08 kurtwaldowski-echelon

Thanks!

davidfig avatar Aug 13 '22 12:08 davidfig