Bug 416833 - Select shapes tool geometry input fields not properly handling decimal values
Summary: Select shapes tool geometry input fields not properly handling decimal values
Status: RESOLVED DUPLICATE of bug 466582
Alias: None
Product: krita
Classification: Applications
Component: Tools/Vector (show other bugs)
Version: git master (please specify the git hash!)
Platform: Debian unstable Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-27 20:12 UTC by Griffin
Modified: 2024-01-22 08:13 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
example reproduction of bug (283.86 KB, image/png)
2020-01-27 20:12 UTC, Griffin
Details
Fractional Pixel Positioning (7.38 KB, image/png)
2020-01-28 16:19 UTC, Ahab Greybeard
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Griffin 2020-01-27 20:12:04 UTC
Created attachment 125469 [details]
example reproduction of bug

SUMMARY

When you specify a position or size with decimal values of pixels, the shape is rendered correctly, but the tool used for displaying the position/size rounds to an integer value


STEPS TO REPRODUCE
1. Set snapping to pixels
2. On a vector layer, create a rectangle with a 1 pixel stroke
3. Notice the blur 
4. select shapes tool -> tool options -> X = [old value].5 px
5. X should now show ether [old value] or [old value+1] and the blur is gone

OBSERVED RESULT

Decimal position and size values are respected by display but not by the input fields.

EXPECTED RESULT

Either the display also rounds the value or
the input displays the correct value (referred)

ADDITIONAL INFORMATION

Krita

 Version: 4.3.0-prealpha (git 7b6c721)
 Languages: en_CA, en, en, en_CA, en
 Hidpi: true

Qt

  Version (compiled): 5.12.5
  Version (loaded): 5.12.5

OS Information

  Build ABI: x86_64-little_endian-lp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: linux
  Kernel Version: 5.4.0-2-amd64
  Pretty Productname: Debian GNU/Linux bullseye/sid
  Product Type: debian
  Product Version: unknown

OpenGL Info
 
  Vendor:  "Intel Open Source Technology Center" 
  Renderer:  "Mesa DRI Intel(R) Haswell Mobile " 
  Version:  "3.0 Mesa 19.2.6" 
  Shading language:  "1.30" 
  Requested format:  QSurfaceFormat(version 2.0, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize -1, redBufferSize -1, greenBufferSize -1, blueBufferSize -1, alphaBufferSize -1, stencilBufferSize -1, samples -1, swapBehavior QSurfaceFormat::DefaultSwapBehavior, swapInterval 1, colorSpace QSurfaceFormat::DefaultColorSpace, profile  QSurfaceFormat::NoProfile) 
  Current format:    QSurfaceFormat(version 3.0, options QFlags<QSurfaceFormat::FormatOption>(DeprecatedFunctions), depthBufferSize 0, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 0, stencilBufferSize 0, samples -1, swapBehavior QSurfaceFormat::DefaultSwapBehavior, swapInterval 1, colorSpace QSurfaceFormat::DefaultColorSpace, profile  QSurfaceFormat::NoProfile) 
     Version: 3.0
     Supports deprecated functions true 
     is OpenGL ES: false 

QPA OpenGL Detection Info 
  supportsDesktopGL: true 
  supportsOpenGLES: true 
  isQtPreferOpenGLES: false 

Hardware Information

  GPU Acceleration: none
  Memory: 31800 Mb
  Number of Cores: 8
  Swap Location: /tmp

Current Settings

  Current Swap Location: /tmp
  Undo Enabled: 1
  Undo Stack Limit: 30
  Use OpenGL: 0
  Use OpenGL Texture Buffer: 1
  Use AMD Vectorization Workaround: 0
  Canvas State: OPENGL_SUCCESS
  Autosave Interval: 900
  Use Backup Files: 1
  Number of Backups Kept: 1
  Backup File Suffix: ~
  Backup Location: Same Folder as the File
  Use Win8 Pointer Input: 0
  Use RightMiddleTabletButton Workaround: 0
  Levels of Detail Enabled: 0
  Use Zip64: 0


Display Information
Number of screens: 1
	Screen: 0
		Name: eDP-1
		Depth: 24
		Scale: 1
		Resolution in pixels: 1920x1080
		Manufacturer: AU Optronics
		Model: 
		Refresh Rate: 60
Comment 1 Ahab Greybeard 2020-01-28 16:19:19 UTC
Created attachment 125493 [details]
Fractional Pixel Positioning

The idea of fractions of a pixel is interesting and probably useful when calculating things like Gaussian Blur and rotation transforms.

When applied to vectors projected onto a raster grid then it shows 'strange effects'

Note that snapping to a 1 pixel grid only works if your cursor is close the the snapping target. If not, the cursor position can return fractional pixel coordinates from its relative screen location and these seem to be used during vector object creation and positioning and rendering.

In the 'Fractional Pixel Positioning' attachment, the six small 1px wide vector rectangles are all identical, made by copy/pasting the first one.

I moved them to arrange them, with grid set to 1px and grid snapping on. I could still position them at fractional pixel positions to give different rendered appearance.

It may be that this needs to happen as part of general vector storage and processing since vectors have to carry exact and detailed size information.

I'll set this to CONFIRMED in case it is a UI/Usability problem and see what the developers say.
Comment 2 vanyossi 2020-01-31 18:17:09 UTC
Related to bug 390950
Comment 3 Tiar 2020-12-11 19:50:08 UTC

*** This bug has been marked as a duplicate of bug 390950 ***
Comment 4 Tiar 2024-01-22 08:13:04 UTC

*** This bug has been marked as a duplicate of bug 466582 ***