#2029: fix regression bug where cursor was no longer updated on zoom#2046
#2029: fix regression bug where cursor was no longer updated on zoom#2046spaghetti22 wants to merge 11 commits intoPintaProject:masterfrom
Conversation
|
Thanks for looking into this! Reading through the code I'm not really a big fan of how things originally worked with this The
These are the changes I think we could make:
|
- fix bug in slash brush where the angle could be perceived as slightly off due to zero-area correction - fix bug in cursor creation where at high zoom levels the slash brush cursor was no longer correctly drawn
|
I implemented the changes as you requested them, except that I didn't add a scale parameter to CreateIconWithShape, which struck me as unnecessary because it would always be called with the same value and this would make the code unnecessarily complex. I also fixed two bugs:
|
cameronwhite
left a comment
There was a problem hiding this comment.
Thanks for the changes!
except that I didn't add a scale parameter to CreateIconWithShape, which struck me as unnecessary because it would always be called with the same value
I think that value should be changing unless I was misunderstanding something as I read the code. If the canvas is zoomed, then the sequence would be
- workspace sends out a ViewSizeChanged event and the tool decides to update its cursor
- this eventually calls CreateIconWithShape
- the local
zoomvariable is computed from the active document's workspaceScalewhich should have changed already to reflect the zoom percentage. This is going through the globalPintaCore.Workspacecurrently and is what I was thinking should be passed in to eliminate the global
…w days, but this is a first draft)
OK, I see what you mean. I didn't mean that it was always the same (absolute) value, merely that the value would always come from the same source. I've now changed it the way you requested. |
| public override Cursor DefaultCursor { | ||
| get { | ||
| double scale = 1; | ||
| if (workspace is not null && workspace.HasOpenDocuments) { |
There was a problem hiding this comment.
Not sure if I'm missing something from just reading the code, but shouldn't workspace always be non-null here?
This block seems to be the most annoying bit of code duplication, so I think adding a helper method in WorkspaceServiceExtensions could be justified.
The changes are looking great otherwise!
Hi, here's the fix for the bug I unfortunately introduced and didn't notice.