Bug 388930

Summary: Image cropping UI broken
Product: [Applications] calligracommon Reporter: sebpe <sebpe>
Component: flake-pictureAssignee: Calligra Bugs <calligra-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: sebpe
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 3.1.0
Sentry Crash Report:
Attachments: gray shape covering the image cropping preview at the bottom left
gray shape covering parts of the image cropping preview

Description sebpe 2018-01-13 22:15:05 UTC
Created attachment 109845 [details]
gray shape covering the image cropping preview at the bottom left

The Image Cropping UI on the "Picture editing" Tab of the general docker shows some opaque grey shape instead of the the cropping borders.
Until the Top, Bottom, Left and Right cropping borders are not set to some larger value using the spin boxes above, the shape will cover the entire image preview.
Setting the cropping with the mouse still works but you have to spot the handles blindly.

Steps to reproduce:
 - open an empty document in words
 - insert an image
 - go to the "Picture editing" tab
 - change the values of the Top, Bottom, Left and Right spin boxes

I can always reproduce this within words, sheets, stage and karbon using arch (recent git-master) and (K)ubuntu (3.0.1).
Comment 1 sebpe 2018-01-13 22:19:03 UTC
Attachment description should be "gray shape covering the image cropping preview at the bottom right"
Comment 2 sebpe 2018-01-13 22:21:27 UTC
Created attachment 109846 [details]
gray shape covering parts of the image cropping preview
Comment 3 Dag Andersen 2018-01-24 18:50:23 UTC
Git commit 307f940655583b5a0efbfffc6460b66bb51a2e5e by Dag Andersen.
Committed on 24/01/2018 at 18:47.
Pushed by danders into branch 'master'.

Paint crop rectangle and its handles with 1px wide outline.

Due to the painter scaling the pen width (1 by default) was scaled too, which caused the outlines to cover the whole image.

This patch sets the pen width to 0 which always results in a 1px wide line, unfortunately also on HiDPI-Displays.
Using a pen width of 1 and changing everything to work with absolute coordinates to fix that seemed a little cumbersome, so I added a dark overlay for the cropped region to improve visibility instead.

Patch by Sebastian Pettke.
FIXED-IN: 3.1.0

M  +8    -1    plugins/pictureshape/CropWidget.cpp

https://commits.kde.org/calligra/307f940655583b5a0efbfffc6460b66bb51a2e5e