Bug 155506 - Particular choice crop size steps in the spinbox increasing/decreasing crop left/right/top/down
Summary: Particular choice crop size steps in the spinbox increasing/decreasing crop l...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.5.0 release
Hardware: All All
: low minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Image-Crop
  Show dependency treegraph
 
Reported: 2023-05-26 09:38 UTC by Telesto
Modified: 2024-11-25 18:32 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2023-05-26 09:38:35 UTC
Description:
Particular choice crop size steps in the spinbox increasing/decreasing crop left/right/top/down 

Steps to Reproduce:
1. Open attachment 187514 [details]
2. Select the image
3. Press F4 or Format -> Image -> Properties
4. Crop tab
5. Crop left. 
6. Press Arrow up/down (or scroll up/down). The crop increments with 0,91 cm. (odd choice)
7. Go top position and size tab.
8. Go to the width field: press arrow up/down. increments with 0,10 cm (which seems decent)

Actual Results:
Increments with 0,91 cm

Expected Results:
increments with 0,10 cm


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 7.6.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 22950a9b008e1bb22fa9e54b5d45715e25fee764
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: nl-NL (nl_NL); UI: en-US
Calc: CL threaded
Comment 1 Heiko Tietze 2023-05-30 09:39:20 UTC
Indeed, odd choice (left/right is 0.91cm top/bottom 1.4cm).
Comment 2 Buovjaga 2024-11-25 18:32:55 UTC
Still the same and already in 3.5.

This is defined in SvxGrfCropPage::GraphicHasChanged in cui/source/tabpages/grfpage.cxx

The increment is not fixed, but is based on the width of the image. Try with different images and see.

sal_Int64 nSpin = m_xLeftMF->normalize(m_aOrigSize.Width()) / 20;
nSpin = vcl::ConvertValue( nSpin, m_aOrigSize.Width(), 0,
                                        eUnit, m_xLeftMF->get_unit());

...

m_xLeftMF->set_increments(nSpin, nSpin * 10, FieldUnit::NONE);