Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed canvas scrolling and size ratio #96

Merged
merged 6 commits into from
Jul 10, 2020
Merged

Fixed canvas scrolling and size ratio #96

merged 6 commits into from
Jul 10, 2020

Conversation

RelativeForce
Copy link
Collaborator

@RelativeForce RelativeForce commented Jul 9, 2020

Issues

closes #56
closes #88

Summary of changes

  • Renamed initialBounds to unitBounds
  • Added canvasSizeToBounds to scale the unitBounds such that Canvas display ratio #88 is satisfied
  • Changed the scroll event listener target to be the canvas instead of the document. Scroll zooming will now only work when the mouse is over the canvas.
  • Moved findElementById into Components.Common.HTML as it is a common function.
  • Updated findElementById so that it will throw an error if the element is not found instead of failing silently
  • Renamed onResize to resize in Components.Canvas.Controller
  • Removed Scroll action from Components.Main

Tests

  • Test.Plot.JobBatcher.HasJobs (Updated)
  • Test.Plot.JobBatcher.SetRunning (Updated)

@RelativeForce RelativeForce added bug Something isn't working enhancement New feature or request labels Jul 9, 2020
@RelativeForce RelativeForce added this to the M7 (UI Polish) milestone Jul 9, 2020
@RelativeForce RelativeForce self-assigned this Jul 9, 2020
@RelativeForce RelativeForce mentioned this pull request Jul 9, 2020
1 task
@RelativeForce RelativeForce marked this pull request as ready for review July 9, 2020 17:01
@michalkonecny
Copy link
Owner

Thank you. This has worked very well in my tests so far, only with some minor niggles:

  • The "reset bounds" button resets both x and y bounds to -1,1. It should reset to the initial bounds.
  • When I make the window very narrow but with the canvas still on the right, the left column gets so narrow that the accuracy text box disappears. There should be a larger minimum width for the column so that none of the controls would disappear with this type of narrow window.

Copy link
Owner

@michalkonecny michalkonecny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@RelativeForce RelativeForce merged commit 54cc1ca into master Jul 10, 2020
@RelativeForce RelativeForce deleted the canvas-fixes branch July 10, 2020 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Canvas display ratio Mouse scroll should not zoom outside canvas
2 participants