Jump to content

Snapping overrides/interferes with forced pixel alignment when pasting/moving with mouse


Recommended Posts

This may be intentional, but it's non-obvious: when trying to work on pixel art/assets, with "Force pixel alignment" and "Move by whole pixels" enabled, having "Snapping" enabled as well often leads to half pixel coordinates when pasting pixel content and when moving items/layers/elements with the mouse. If this is intentional, it should be made visually clearer somehow. Otherwise, even when snapping is enabled, the coordinates should still honour pixel alignment/whole pixels.

screenshots: in the pixel font only example, dragging the layer with the mouse moves it in whole and half pixel steps, despite the "move by whole pixels". in the paperboy example, copy/pasting a pixel layer of 45x34px on a 150x150px document pastes it at the center, resulting in half pixel coordinates. again, it should honour the "force pixel alignment" here.

 

 

Screenshot 2020-09-19 225231.png

copy-paste.png

Link to comment
Share on other sites

I'm not sure what's happening, but just to make sure you know: with "move by whole pixels" enabled, if something starts out positioned at a fractional pixel, say at X=4.5px, and you move it horizontally, when you stop it will still be on a.5px boundary. The movement is in whole pixels with that option on, e.g. from 4.5 to 5.5 to 6.5, etc.

That suboption of "force pixel alignment" keeps unaligned objects unaligned as they move, while forcing new items to be aligned, and aligned items to stay aligned.

I don't know if that explains any of what you're seeing.

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
    Laptop 2: Windows 11 Pro 24H2,  16GB memory, Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) 12 Core CPU 4.01 GHz, Qualcomm(R) Adreno(TM) X1-85 GPU
iPad:  iPad Pro M1, 12.9": iPadOS 17.7, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.7

Link to comment
Share on other sites

ok, let me explain further: when all options are enabled (force pixel alignment, move by whole pixels, snapping):

- pasting some pixel data to a new layer will always attempt to center that layer. depending on dimensions of the document and the pixel data you're pasting, the new layer with the pasted data can end up being pasted at a half pixel position. i'd expect that, with "force pixel alignment", pasting it would still try to paste and position it at a full pixel coordinate.

- moving items with the keyboard does indeed move them by whole pixels. however, when snapping is enabled, moving elements with the mouse moves them by half pixels as well. only if i turn of snapping does moving elements with the mouse always put them on whole pixels

Link to comment
Share on other sites

if these aren't bugs but "works as intended, just unintuitive/surprising for users", then feel free to move this to something more appropriate like the feature request section (with the request being to either *really* force pixel alignment even when snapping is enabled, moving things with mouse and pasting things always on full pixels only, introducing some further "also force this when snapping is enabled" extra option, or at least visually separating the "force pixel alignment" and "move by whole pixels" from the "snapping" button if they're interfering / interacting in surprising ways and it's intentional and to be kept this way)

Link to comment
Share on other sites

Link to comment
Share on other sites

the problem seems to boil down to two things:

- if the pixel clipboard data has odd dimensions, and the document itself has even dimensions, pasting will center the pixel data's center point to the center of the document. e.g. if the document is 150x150px, and my clipboard contains a 31x31px chunk, it will place the center of that chunk at x:75 and y:75, but then all the edges will be on half pixels (because 31/2 = 15.5). this regardless of any "force pixel alignment"

- it seems it's not the "Snap to grid" that was giving me issues when moving the layer with the mouse, but rather the various "mid points" that kept dragging the layer to align to half pixels

For the first point, that may be considered a bug (if I paste pixel data in a document with forced pixel alignment, i'd expect the paste operation to also obey the forced pixel alignment). For the latter, it may be "as intended", but it's certainly unexpected that, again, when forced pixel alignment is in place, you can still end up moving things to half pixels due to the midpoint etc snapping.

Link to comment
Share on other sites

12 hours ago, patrick_h_lauke said:

For the latter, it may be "as intended", but it's certainly unexpected that, again, when forced pixel alignment is in place, you can still end up moving things to half pixels due to the midpoint etc snapping.

I suspect it's intended, and the theory is that by adding those snapping options you're providing additional overrides (beyond the possible "Move by Whole Pixels") that take precedence. If you didn't want that, you wouldn't set those options.

Of course, even if I'm right, it requires a fairly good level of knowledge for users to use it successfully.

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
    Laptop 2: Windows 11 Pro 24H2,  16GB memory, Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) 12 Core CPU 4.01 GHz, Qualcomm(R) Adreno(TM) X1-85 GPU
iPad:  iPad Pro M1, 12.9": iPadOS 17.7, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.7

Link to comment
Share on other sites

  • 1 year later...

as I was recording a video already for 

here's also a video of the problem here. copy a pixel-perfect selection into another document - despite all the snapping and aligning to pixel grid etc on, it will paste it to whatever the middle of the image/viewport is, often leading to fractional coordinates. it should ideally, when pixel snapping/aligning is turned on, then round it up and paste it to the nearest full pixel instead, I'd say. (in this video, the copied bit is 143px x 57px, and the target document is 150px x 150px. once pasted, the bit is positioned to X 2px and Y 46.5px)

 

 

 

Link to comment
Share on other sites

another video recording, just to rule out some other factors. source document is a fullscreen screenshot 1920x1080 at 96dpi. I made a selection of 142x45 and copied it. then, I open a new 150x150 at 96dpi document, and paste. i have Force Pixel Alignment checked, and unchecked everything else just to make sure it's not interfering. the pasted clipboard data is positioned at X 4px and Y 57.5px ... i.e. it tries to center the pasted data.

it *may* be that it's because the source document is much larger than the target document, and the coordinates where the clipboard data was copied from are out of bounds of the target document, so it instead tries to center it. but the centering does *not* take into account the "Force Pixel Alignment" and just does a naive centering resulting in fractional coordinates. /cc @Dan C

 

 

Link to comment
Share on other sites

Thanks for the further screen recording & information provided!

44 minutes ago, patrick_h_lauke said:

it *may* be that it's because the source document is much larger than the target document, and the coordinates where the clipboard data was copied from are out of bounds of the target document, so it instead tries to center it. but the centering does *not* take into account the "Force Pixel Alignment" and just does a naive centering resulting in fractional coordinates.

I agree, and I believe this is the step I was missing in my testing. Going from the smaller to larger document works as expected, as the X&Y location of the layer/copied information can be respected - but when going from larger to smaller, where the X&Y values would be off canvas, the object is pasted centrally and ignores the aforementioned snapping options.

As far as I'm aware, I believe this to be a bug also, so I'm getting it logged with our devs now :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.