Menu

#5 Paste doesn't work when zoomed in

open
nobody
None
5
2025-02-15
2010-12-13
Roger P
No

If the window is smaller than the picture (zoomed in) and I paste then the "navigation marker" and pasted image doesn't align.

Discussion

  • Peter Hull

    Peter Hull - 2015-05-03

    I think I've had the same problem but it doesn't happen when the picture is zoomed it, per se, but when the scroll bars are not at their top-left position. I made a small fix, attached, which seemed to fix it for me but I may be missing the reason why the code was like it was.

    Thanks for all your work on Paintbrush!

     
  • Olaf Wagner

    Olaf Wagner - 2025-02-13

    I have exactly this problem, and like described above pasting does seem to work when the image is scrolled to the top left corner.

    Can you please explain how to apply this fix?

     
  • Peter Hull

    Peter Hull - 2025-02-13

    Hi Olaf,
    As you see it's been nearly a decade since my last post.
    Are you able to build Paintbrush from source?
    If so:

    1. Fetch the source with subversion
    2. Go to paintbrush-code/Paintbrush2/branches/2.1
    3. Download the patch diff-v-current-svn from my earlier post
    4. Apply the patch with patch < diff-v-current-svn
    5. Build Paintbrush!

    I was able to do the first four (the patch still applies cleanly) but the build didn't work. I am on MacOS 15 now so I guess things have changed a lot since this project was last updated. There seem to be refernces to MacOS 10.15.

    Let me know how you get on.

    Peter

    By the way the patch is really small, it's just

    Index: SWSelectionTool.m
    ===================================================================
    --- SWSelectionTool.m   (revision 165)
    +++ SWSelectionTool.m   (working copy)
    @@ -347,7 +347,7 @@
        SWLockFocus(selectedImage);
        [[NSGraphicsContext currentContext] setImageInterpolation:NSImageInterpolationNone];
        // Create the point to paste at
    
    -   NSPoint point = NSMakePoint(clippingRect.origin.x, clippingRect.origin.y + (clippingRect.size.height - selectedImage.size.height));
    +    NSPoint point = NSMakePoint(0.0, clippingRect.size.height - selectedImage.size.height);
        [image drawAtPoint:point];
        SWUnlockFocus(selectedImage);
    
     
  • Olaf Wagner

    Olaf Wagner - 2025-02-14

    Thanks for the response Peter. I managed to pull the source (v2.1) and applied the patch (I just changed out the line of code manually). I then had to upgrade the build version for a number of windows to 'current version' and also re-add the Sparkle framework to the project dependencies, and then managed to get the project to build.

    Unfortunately it doesn't run properly (the toolbox just shows a black box instead of all the icons, and there are a ton of warnings about deprecated code - I too am on macOS 15), however, I was able to verify that your fix does indeed work properly.

    What will it take to get this rolled into the next official update? (perhaps v2.7)

     

    Last edit: Olaf Wagner 2025-02-14
  • Peter Hull

    Peter Hull - 2025-02-15

    Independently I did the same and came to the same conclusion, although I did just comment out all the sparkle code. I don't know if this project is actively under development, I suspect not as there are very few commits recently.

    Strangely the toolbox is visible in Xcode
    Xcode

    but does not appear properly in the running app.
    App

    The one control that is visible makes the whole thing white - so I suspect it's the color wells which are filling the entire toolbox.

    I tried to edit it, to fix this but nothing I did helped.

     

    Last edit: Peter Hull 2025-02-15

Log in to post a comment.

Monday.com Logo