Bug 397218 - inaccurate Layer -> Transform -> Offset when canvas size is 2048x2048. I input X:64px offset to a 64x64 content, it made 63px offset instead of 64px. When input is X:65px, it made 65px offset. There is no way to make accurate 64px offset.
Summary: inaccurate Layer -> Transform -> Offset when canvas size is 2048x2048. I inpu...
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Unclassified
Component: General (show other bugs)
Version: 4.1.0
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-06 17:21 UTC by bryanlonghin
Modified: 2018-08-11 19:00 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
This is a youtube video link which reproduces the described bug (28 bytes, text/plain)
2018-08-06 17:21 UTC, bryanlonghin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bryanlonghin 2018-08-06 17:21:25 UTC
Created attachment 114337 [details]
This is a youtube video link which reproduces the described bug

To reproduce this bug. Follow the steps done in the attached youtube video.
For smaller canvas size, it works. However, for 2048x2048, it has this problem.
Comment 1 Halla Rempt 2018-08-07 08:28:59 UTC
Setting to normal: critical is for dataloss. I've tried to reproduce, but if I enter an offset of 64, 64 in the offset dialog, I don't see the pixel mismatch. Your video goes a bit too fast for me to really see what you entered in that dialog, though.
Comment 2 bryanlonghin 2018-08-07 08:38:16 UTC
(In reply to Boudewijn Rempt from comment #1)
> Setting to normal: critical is for dataloss. I've tried to reproduce, but if
> I enter an offset of 64, 64 in the offset dialog, I don't see the pixel
> mismatch. Your video goes a bit too fast for me to really see what you
> entered in that dialog, though.

This bug doesn't exist when I use a smaller canvas size, but when canvas size is 2048x2048, this bug occurs. I chose this canvas size using the texture template instead of custom document (don't know if this is useful information). I put 64px on X and 0px on Y in the dialog.
Comment 3 bryanlonghin 2018-08-07 08:41:16 UTC
Ok, sorry I didn't tell you how I made my canvas size. I tested this bug again with canvas size 2048x2048 created by custom document and this bug did not occur. This bug is associated with texture template.
Comment 4 Halla Rempt 2018-08-07 08:41:53 UTC
Ah... That explains why I couldn't reproduce it. Let me try again.
Comment 5 Halla Rempt 2018-08-07 08:45:41 UTC
Yes, with this template, I can reproduce the issue.
Comment 6 Halla Rempt 2018-08-07 09:17:07 UTC
It is a matter of the ppi, it seems. If I create a new image with 100 dpi, like the template, the offset happens. If it's 300 dpi, as is the default, it doesn't. So there must be some rounding error.
Comment 7 bryanlonghin 2018-08-07 09:19:16 UTC
oh, then I will use custom document from now on.
Comment 8 Halla Rempt 2018-08-07 09:27:53 UTC
Git commit c10d7c836d07618cc8149a813acb70e55a837c6e by Boudewijn Rempt.
Committed on 07/08/2018 at 09:27.
Pushed by rempt into branch 'master'.

Fix the offset dialog giving inaccurate offsets

When assinging a double to an int, round it, don't just assign it.

M  +2    -2    plugins/extensions/offsetimage/dlg_offsetimage.cpp
M  +3    -3    plugins/extensions/offsetimage/dlg_offsetimage.h

https://commits.kde.org/krita/c10d7c836d07618cc8149a813acb70e55a837c6e
Comment 9 Halla Rempt 2018-08-11 19:00:17 UTC
Git commit ff20df4ed7216b062a745e07cd826d6b6c35d440 by Boudewijn Rempt.
Committed on 11/08/2018 at 15:24.
Pushed by rempt into branch 'krita/4.1'.

Fix the offset dialog giving inaccurate offsets

When assinging a double to an int, round it, don't just assign it.

M  +2    -2    plugins/extensions/offsetimage/dlg_offsetimage.cpp
M  +3    -3    plugins/extensions/offsetimage/dlg_offsetimage.h

https://commits.kde.org/krita/ff20df4ed7216b062a745e07cd826d6b6c35d440