ZMYaro / paintz

A simple drawing app that runs in a web browser, designed to be an MS Paint substitute for Chromebooks and other Chrome OS devices. PaintZ is free, but please consider supporting development at https://ko-fi.com/ZMYaro or https://patreon.com/ZMYaro.
https://paintz.app
53 stars 11 forks source link

Pan tool dragging with right-click jumps drag point to the last left-click position #220

Closed ZMYaro closed 3 years ago

ZMYaro commented 3 years ago

Steps to reproduce the behavior

  1. Enlarge or zoom the canvas larger than the window and switch to the pan tool.
  2. Drag the canvas with the left mouse button.
  3. Move the pointer to a different place and drag the canvas with the right mouse button.

Expected behavior The canvas either drags from that point or does not allow dragging with the right mouse button.

Actual behavior The canvas jumps so the cursor is over the part of the image that was previously dragged with the left mouse button.

(Caught by David Martin.)

ZMYaro commented 3 years ago

This was caused by PanTool.prototype.start ignoring all but the left mouse button, but move and end not caring. Since all other tools can be used with either mouse button, I removed the restriction from start.

ZMYaro commented 3 years ago

Fixed in https://github.com/ZMYaro/paintz/commit/a6f98335672b17b2a174c2c6a368315bba52454c.