-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
show snapshots side-by-side #18281
show snapshots side-by-side #18281
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works good, two issues:
- In side-by-side when you zoom you cannot pan. Try to click an pan the picture change the split orientation and create some strange shadow effect over one image from time to time.
- In side-by-side, when zoomed in and after trying to pan it seems that we have a process recomputing in loop, we have the label "working..." appearing.
Did you read the PR? I did not change the pan behavior in overlay; it always required the "force pan/zoom/rotate with mouse" (a) button to be held. And since you cannot move the divider, any click is interpreted as rotate instead. It makes sense to revisit the decision to make the canvas not sensitive when in snapshot mode. When side-by-side, we could just have masks drawing etc functional in the "current" side. Even in the overlay snapshot mode, we could have it functional on the "uncovered" side and only move the divider line when clicked on/near it and dragged. This will take a bit longer to get right carefully. In the mean time I don't want to waste too much time making the intermediate solution perfect.
Is this a regression or the same thing that happens in normal snapshot mode? For the "current" side we fill in the not-yet computed zoomed+panned area from the "preview" (full image top left). For the snapshot we don't calculate a separate preview image, so we use the same preview as the normal image, which might look very different. If you are like me you test snapshots by creating one and then changing exposure, so filling in the snapshot from the darker preview image creates a "shadow". Or are talking about something else?
Yes, I see that sometimes. I can't think of a reason why this PR would cause that (except that the viewport tends to be narrow). I've checked that it is not caused by one side of the window being one pixel wider than the other. So maybe this is another case of this kind of behavior that I've seen reported previously (can't find it now) and that might be rounding errors of position calculation. |
It seems no, and more importantly this is a common dt feature (pressing A) so I should have remembered. Let's put that on the tiredness, I'm doing too many things. |
No I don't think we need to revisit that. So after a second testing, it works ok on my side. The issue I was talking about is something else, the snapshot area when returning to the "overlay" mode do not get redrawn and so may be wrong... The fix is simple, we need to invalidate the snapshot, my proposal:
|
gtk (since 2.0) already takes care of this. Added extra checks to avoid warnings.
I improved the way a redraw of the snapshot "window" gets triggered. Sometimes it wouldn't when it should. Would you please see if that solves the issue as well? There should be no need to always force a recalc separately; the resize should do that if needed. Also removed a level of double buffering that's been there forever and that nobody has ever looked at since (presumably). Since gtk2.0 double buffering is already done in the toolkit so we should not do it again. I think when I rejigged the whole zoom/pan thing I also removed a double buffer, so originally we quadruple buffered! One of those "for good measure" and "let's assume (based on nothing) that they knew what they were doing and not fix anything". But of course if there was a good reason for additional triple buffering, I'll drop the second commit. Since now gtk receives back the same cr it handed us, it notices if we messed up the transformation matrix, which apparently happened when no image had finished loading yet. Some extra checks solved the resulting error messages. |
Still an issue, take a picture, just added an history to have the image B&W to better see the issue.
See the right part of the image (the snapshot) gets part color (which is good) and part in B&W (which is wrong): |
And using my patch above I cannot reproduce. |
I see what you are saying, but the "part b&w part color" snapshot is only temporary, while the snapshot is being recalculated. Both before and after your patch it corrects (to all color) after a few moments (for me). So The only drawback I see is that IF someone in future makes the BTW the other issue, flickering "working..." which I sometimes get when rotating while zoomed does cause pieces of the snapshot to not get updated. So I've now added a Any comments on the double buffering removal? |
I think this is all good (and removes code that could be duplicated :-)
Or could some code part fight against main canvas size? |
Not just that; it allocated a chunk of memory and copies needlessly. So should be (unnoticeably) faster now.
Maybe. I'd have to dig in and understand the snapshot generation code again. Anyway, seems to be solved by my last commit... |
No, seems to be ok on my testing. Hopefully this is ok also on macOS and Windows. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Working fine for me, thanks a lot!
Need a release note entry for the "big one" section.
Release note:
|
Adds a button next to "take snapshot" to change to a side-by-side (or over-under) view of snapshot next to the current image.
This completely depends on both sides being exactly the same dimensions, so don't even think about asking if the dividing line can be made moveable. Clicking anywhere is interpreted as clicking on the rotate button. If you want to move (after zooming in) you need to keep the A key pressed (as you normally would, with an overlayed snapshot) while dragging.
In all likelihood this PR will break stuff. Especially stuff that depends on the "center" view being directly contained within the "center_base" overlay. This PR adds an extra layer in between (a box that holds two views). Lighttable does funky stuff with "center_base" as does Maps. I won't pretend I understand any of it or that I did any testing. At all.
fixes #18270