Bug 341107 - Mismatching resolution for vector layers
Summary: Mismatching resolution for vector layers
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Tools (show other bugs)
Version: 2.8.5
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-19 18:53 UTC by Ricardo Urbina
Modified: 2014-12-02 11:12 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ricardo Urbina 2014-11-19 18:53:35 UTC
I'm working on an image which is 5 inches wide at 300 ppi. I set up the grid for half-inch stops, and I noticed that a square shape in a vector layer doesn't snap to the grid, and snapping is awful. But then in the geometry part of tool options I noticed strange pixel sizes. As it turns out, the vector engine believes my 1500 pixel wide image is only 360 pixels wide, that's only 72 ppi.

So, reported pixel density in the vector engine doesn't match my image's. It doesn't match my monitor either, which reports 96 dpi via xdpyinfo.

Reproducible: Always

Steps to Reproduce:
1. Create a new image of 300 x 300 pixels at 300 dpi
2. Create a new vector layer
3. Draw a square
4. Resize it to 72x72 pixels.

Actual Results:  
Square resizes to 1x1 inches.

Expected Results:  
Square resizes to .24 x .24 inches.

Happens on my laptop and my desktop, both with Gentoo Linux. xdpyinfo reports 96 dpi for both. 72 dpi is a magic number, so I suppose the Calligra vector engine is not performing a coordinate transofrm or not getting the dpi datum to act apropiately?
Comment 1 Halla Rempt 2014-11-25 09:18:55 UTC

*** This bug has been marked as a duplicate of bug 313600 ***
Comment 2 Dmitry Kazakov 2014-12-02 11:12:37 UTC
Git commit fddc5e9cc648c4d0eceb67b793faa3c0c14b8d62 by Dmitry Kazakov.
Committed on 28/11/2014 at 11:14.
Pushed by dkazakov into branch 'krita-chili-kazakov'.

Fix Default tool widgets to show values in real pixels, not points

Now the option widgets use correct KoUnit object to convert their
options in correct user-visible pixels. Some note on the implementation:

1) Affects KoStrokeConfigWidget and DefaultToolWidget
2) The correct conversion value is stored in KoUnit, which is reported
   by KisCanvas2 and retransmitted by KisView2.
3) There is a hack in KoStrokeConfigWidget. KoShapeStroke knows nothing
   about the absoluteTransformation() of the shape, which doesn't stop
   the shape from doing the transformation of the outline (loaded into
   QPainter directly). So we take it into account manually, by adding
   a multiplier into KoUnit.
Related: bug 313600

M  +17   -1    krita/ui/canvas/kis_canvas2.cpp
M  +2    -0    krita/ui/flake/kis_shape_controller.cpp
M  +2    -1    krita/ui/flake/kis_shape_controller.h
M  +4    -0    krita/ui/kis_view2.cpp
M  +3    -1    libs/odf/KoUnit.h
M  +35   -2    libs/widgets/KoStrokeConfigWidget.cpp
M  +12   -1    libs/widgets/KoUnitDoubleSpinBox.cpp
M  +3    -0    plugins/defaultTools/defaulttool/DefaultToolWidget.cpp

http://commits.kde.org/calligra/fddc5e9cc648c4d0eceb67b793faa3c0c14b8d62