Pattern-Projector / pattern-projector

https://www.patternprojector.com/
MIT License
27 stars 13 forks source link

Add magnify and zoom out #288

Open courtneypattison opened 2 weeks ago

courtneypattison commented 2 weeks ago

Pull Request Checklist

Description

Related Issues

91 #256

TODO

Still needs lots of testing and fixes but I thought I'd share anyway to show what I'm working on :)

More issues found when testing:

vercel[bot] commented 2 weeks ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
pattern-projector ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 1, 2024 7:00pm
courtneypattison commented 4 days ago

This PR is finally ready for testing if anyone has the time please feel free to critique @sashasewist @Nifdee @cfcurtis @roel-v @hluedeke! I'm going to try to do a cutting session today to find pain points and bugs. Happy Canada Day! 🇨🇦

I'm thinking maybe instead of click to zoom back in, show a rectangle representing your viewport and make people drag the pdf to the rectangle to zoom back in.

cfcurtis commented 2 days ago

Awesome! I actually had time to sew, so I took the opportunity to test this out. I think it's a great feature that people will love! Here's a few comments:

Magnify

This may be a big ask, but is it possible to re-render at a higher resolution when magnifying? I tried using the magnify feature to read some small text, but ultimately it was just too low-res to make out. In this case the hover text would work, but sometimes I want to zoom in to check small markings and my expectation is that the resolution would increase.

image

Zoom

  1. The "click to zoom back in" seems pretty intuitive, but a rectangle to show viewport could be helpful as well. I wouldn't call it a show-stopper but maybe a nice to have?
  2. The biggest issue I had is that it wouldn't maintain rotation. To reproduce:
    1. Rotate a pattern
    2. Zoom out, it will appear in the original (un-rotated) view
    3. Click somewhere to zoom in and the rotation is lost

Other comments

Unrelated to the zoom/magnify, I noticed a few quirks in this version:

  1. The "hide menu" button still shows up during calibration, but then goes away for projection. I eventually gave up looking for the button and the menu auto-hid - is the plan for this to replace the button entirely? Seems like a good idea to save clutter, but it was confusing for it to be in calibrate mode and not projection.
  2. There seems to be something odd between the full screen button and F11. I noticed that you've made it stay full screen even after opening a PDF, nice! However, it seems to think that F11 full screen and "button" full screen are different. To reproduce:

    1. Launch PP, hit F11 to enter full screen, then calibrate
    2. Go to Project, open a PDF, and hit F11 again to exit full screen. The warning about the view changing pops up.
    3. Press the full screen button to enter full screen. The warning stays on screen.
    4. Exit full screen (button or F11, doesn't matter), then press F11 to go back to full screen. Warning disappears as expected.

    Honestly the only reason I noticed this is because I usually set things up on my computer and F11 to full screen, then use the mouse to interact with the projection because the keyboard is behind me.

My system info (if relevant)

sashasewist commented 2 days ago

I'm finding a few difficulties with this on firefox on windows. Can test others. Is the zoom out supposed to stay on until I click it off. I worry that people will forget and cut with zoom out still on. Could dots be added like the flip tool, as a reminder that they are in a special mode? The magnify works opposite, doesn't stay on for more than about a quarter second when I click the magnify glass on part of a pattern.

courtneypattison commented 2 days ago

@cfcurtis thank you so much! I absolutely love how organized and thought out your feedback is.

Magnify

This may be a big ask, but is it possible to re-render at a higher resolution when magnifying? I tried using the magnify feature to read some small text, but ultimately it was just too low-res to make out. In this case the hover text would work, but sometimes I want to zoom in to check small markings and my expectation is that the resolution would increase.

I don't think I'll be able to increase the resolution for this release. It's something that I've been trying to look into but it's a bit a of a nightmare. #245 shows an attempt but the performance hit is significant. pdfjs doesn't support tiling :( I'll open an issue to look into different ways to increase the resolution just when zoomed in since that's a bit of a different case.

Zoom

  1. The "click to zoom back in" seems pretty intuitive, but a rectangle to show viewport could be helpful as well. I wouldn't call it a show-stopper but maybe a nice to have?

Agreed!

  1. The biggest issue I had is that it wouldn't maintain rotation. To reproduce:

    1. Rotate a pattern
    2. Zoom out, it will appear in the original (un-rotated) view
    3. Click somewhere to zoom in and the rotation is lost

This was pure laziness on my part. I'll get that fixed!

Other comments

Unrelated to the zoom/magnify, I noticed a few quirks in this version:

  1. The "hide menu" button still shows up during calibration, but then goes away for projection. I eventually gave up looking for the button and the menu auto-hid - is the plan for this to replace the button entirely?

Yes! I'm doing everything I can to save space in the main menu since I keep adding to it.

Seems like a good idea to save clutter, but it was confusing for it to be in calibrate mode and not projection.

I left it in the calibrate mode because some people have their corners behind the menu and would probably panic if they couldn't hide the menu anymore to get to those corners. Any movement would show the menu. I agree it would be nicer to remove it but I worry about that case. I feel like the fix here is a bit of a calibration page redesign. Not sure what that would look like though.

  1. There seems to be something odd between the full screen button and F11. I noticed that you've made it stay full screen even after opening a PDF, nice!

I thought I did as well! I got so excited about it, but there's a timeout from the browser when you click the open PDF button. So if you select your PDF quickly, the full screen will be maintained, otherwise you still get popped out!

However, it seems to think that F11 full screen and "button" full screen are different. To reproduce:

  1. Launch PP, hit F11 to enter full screen, then calibrate
  2. Go to Project, open a PDF, and hit F11 again to exit full screen. The warning about the view changing pops up.
  3. Press the full screen button to enter full screen. The warning stays on screen.
  4. Exit full screen (button or F11, doesn't matter), then press F11 to go back to full screen. Warning disappears as expected.

Good find! I will investigate.

My system info (if relevant)

  • Fedora Linux 40
  • Chrome Version 125.0.6422.60 (Official Build) (64-bit)
  • Artlii Enjoy 2 Mini Projector, extended screen connected via HDMI, 720p resolution

Thank you!!!

courtneypattison commented 2 days ago

I'm finding a few difficulties with this on firefox on windows. Can test others. Is the zoom out supposed to stay on until I click it off.

Yeah, it is supposed to stay on. You click on the spot you want to zoom into. Any ideas for making this more obvious or changing the interaction?

I worry that people will forget and cut with zoom out still on. Could dots be added like the flip tool, as a reminder that they are in a special mode?

I think maybe what @cfcurtis suggested (an outline showing the viewport before zooming out) might make it more obvious. What do you think?

The magnify works opposite, doesn't stay on for more than about a quarter second when I click the magnify glass on part of a pattern.

You have to press and hold for the magnify. I am seeing now how it's weird that the zoom out is click once and the zoom in is click and hold. Hmmm

cfcurtis commented 1 day ago

I think maybe what @cfcurtis suggested (an outline showing the viewport before zooming out) might make it more obvious. What do you think?

That was actually your suggestion!

I thought the higher resolution thing might be a stretch, I see pdf.js has an open issue from 2015, in addition to a number of requests for a zoom feature. As a hack I wonder if it would work to edit the CropBox and then re-render. I can mess around with it a bit and see what happens.

You have to press and hold for the magnify. I am seeing now how it's weird that the zoom out is click once and the zoom in is click and hold. Hmmm

I think a consistent behaviour would be good, though I don't have a strong opinion one way or the other.

courtneypattison commented 8 hours ago

I think maybe what @cfcurtis suggested (an outline showing the viewport before zooming out) might make it more obvious. What do you think?

That was actually your suggestion!

Lol, I forgot I mentioned that.

I thought the higher resolution thing might be a stretch, I see pdf.js has an open issue from 2015, in addition to a number of requests for a zoom feature. As a hack I wonder if it would work to edit the CropBox and then re-render. I can mess around with it a bit and see what happens.

I would love it if you could look into this issue. A second set of eyes would be really helpful. I'm not sure if you have any vogue A0s. Those are the worst case scenario I've seen for load times. I'll send you a mangled one just in case.

You have to press and hold for the magnify. I am seeing now how it's weird that the zoom out is click once and the zoom in is click and hold. Hmmm

I think a consistent behaviour would be good, though I don't have a strong opinion one way or the other.

Okie doke, I'm thinking click to activate magnify, then click to go back to regular scale to match the zoom out functionality since Sasha thought the dragging was a bug.