The sizes of a shape are not consistent in Controls Bar

Bug #311828 reported by qbit
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Inkscape
Confirmed
Undecided
Unassigned

Bug Description

The problem arises when draw a shape with stroke. For example:
1. Draw a rectangle with 1px stroke.
2. While rectangle tool is selected, set the sizes (W: and H:) in Controls Bar to 30 mm.
3. Choose the Selector Tool.
The sizes displayed in Controls Bar are 30,282 mm.
If I'm converting this object using the "Stroke to Path" function, the sizes displayed are 30,277 mm. So, which are the right sizes?

I'm supposing the second measurement (30,282) includes half of the stroke width converted in mm, but then I don't understand why changing the shape to path gives me 30,277.
Anyway, is a good thing to have sometimes the possibility to see the size including the stroke width, BUT, I'd like to have a toggle button in Controls Bar to switch the dimensions displayed with/without stroke width.

(Inkscape 0.46, WinXP SP2)

qbit (paulix)
description: updated
Revision history for this message
su_v (suv-lp) wrote :

You can change the way the bounding box is calculated in the preferences:
'File > Inkscape Preferences > Tools': toggle 'Bounding box to use' to 'Geometric bounding box'

In Inkscape 0.46+devel r22062 the width shown in the select tool controls bar correctly reflects the selected method to calculate the bounding box (Inkscape 0.46 seems to always show the value of the visual bbox width in the controls bar).

- Visual Bbox: width includes stroke
- Geometric Bbox: width excludes stroke i.e. x-, y-distance between the outermost nodes in the selection

Proposing to close this report as fixed, though I don't know when this change was committed.

Revision history for this message
su_v (suv-lp) wrote :

Found it: bug #212768 “Geometric and Visual bounding box and object dimensions”, fix committed in rev. 18352 by buliabyak.

@qbit - could you test with a prerelease build from <http://sourceforge.net/projects/inkscape/files/> if your issue is solved?

su_v (suv-lp)
tags: added: ui ui-selection-group-layer
Revision history for this message
qbit (paulix) wrote :

No, from my point of view, the problem is not solved accurately. Look why:
1. Perform these steps:
a) Set the measurements in mm and set the option "Visual bounding box";
b) Select the Rectangle tool and draw a rectangle with aprox. these dimensions: W: 55mm, H: 20mm (it's important not to be a square from the beginning!), Stroke: 1px;
c) While Rectangle Tool is still selected, resize it to: 30 x 30 mm;
d) Choose the Selector Tool. The Property bar shows: 30,282 x 30,282 mm (that is correct according with the option selected in preferences, BUT...)
e) Select Path > Stroke to Path. The Property Bar shows now 30,277 x 30,277 mm.
Is it normal to change from 30,282 to 30,277 ?

2. If the options "Visual bounding box" and "Geometric bounding box" set the rules for the entire application, my opinion is the Rectangle Tool should follow them as well as the Selector Tool. With other words, if I have the option "Visual bounding box", selected, I think the Property Bar for Rectangle Tool should display the same size as the Property Bar for Selector Tool. Isn't it?

Revision history for this message
su_v (suv-lp) wrote :

> if I have the option "Visual bounding box", selected, I think the Property Bar for Rectangle Tool should display the same size as the Property Bar for Selector Tool

no (caveat: I'm not a developer): see the tool tips for the height and width fields: the select tool controls bar width&height fields respect the bbox setting (they show the width for the selection) whereas the rectangle tool controls bar shows the length of the path segments (and therefor independent of the bbox setting).

to demonstrate:
1) draw rectangle 100x100
2) switch to the select tool, rotate the rectangle, watch the select tool controls bar width&height fields change
3) switch back to the rectangle tool: width&height are still (unchanged) 100x100

Revision history for this message
su_v (suv-lp) wrote :

> Path > Stroke to Path. The Property Bar shows now 30,277 x 30,277 mm.
> Is it normal to change from 30,282 to 30,277 ?

I think that's a different issue, involving another conversion factor that might lead to rounding errors? I get different values: sometimes it's 30.286x30.277mm, other times 30.277x30.286mm. It isn't a square anymore after applying 'Stroke to Path'.

repeating your steps with: all units set to px (internal unit, needs no conversion)
1) draw rectangle 100x200, stroke 10px (to better visualize)
2) resize with rectangle tool controls bar width&height fields numerically to 100x100
3) switch to select tool, size shows correctly 110x110 px
4) apply 'Stroke to Path' -> size stays at 110x110 px

There are other bugs related to the numeric precision values, like
bug #190557 “resize of object or group by entering a numeric size results in a different size”
bug #370137 “"Geometric bounding box" setting does not affect XYWH edit fields on the Tool Controls bar”
but they can be reproduced without unit conversion happening (all units in px)

Revision history for this message
su_v (suv-lp) wrote :

forgot to ask: what is your setting regarding scaling of stroke width (selector tool toggle on the right end of the controls bar)?
I repeated your steps with both 'scale stroke width' and 'scale rounded corners' off.

Revision history for this message
qbit (paulix) wrote :

"~suv wrote on 2009-08-14: > if I have the option "Visual bounding box", selected, I think the Property Bar for Rectangle Tool should display the same size as the Property Bar for Selector Tool

no (caveat: I'm not a developer): see the tool tips for the height and width fields: the select tool controls bar width&height fields respect the bbox setting (they show the width for the selection) whereas the rectangle tool controls bar shows the length of the path segments (and therefor independent of the bbox setting)."

Yes, I know this difference but while from the programmer's point of view this is correct, from the user's point of view this is at least confusing and for sure annoying. Let's focus on scope: what the user wants? He wants to draw a rectangle with a specific size including the size of the stroke as time as he checked "Visual bounding box" because he is working in this way. Am I right?

Let's take a look at the current situation: the user wants a 300x100 mm rectangle including a 4pt stroke size. But he can't obtain this in a single step because what he is drawing is larger that he specified in Rectangle Property Bar. And then, he needs all the time to adjust again the size of a rectangle.

"~suv wrote on 2009-08-14: forgot to ask: what is your setting regarding scaling of stroke width (selector tool toggle on the right end of the controls bar)?"
It is off.

Revision history for this message
su_v (suv-lp) wrote :

Maybe you are right, I don't know. I have to admit I am biased: I have a background in CAAD and the concept of a visual bounding box seems still confusing. To me the stroke is an attribute of an object. I am not (yet?) convinced of the implication that an attribute can change the geometry of the object itself. Thus I can see a logical difference between the height and width controls of the rectangle tool and the size controls of the selecting tool.

Changed in inkscape:
status: New → Confirmed
status: Confirmed → Fix Released
Revision history for this message
Jarl Arntzen (jarl-arntzen) wrote :

Hi. Sorry. I was able to confirm this bug in 0.47. I set the status to Confirmed first, then to Fix released, thinking that it was fixed but then i tried re-creating the bug again and it was still there.

Now I am not allowed by Launchpad to reset the status to Confirmed again. Sorry for the inconvenience.

jazzynico (jazzynico)
Changed in inkscape:
status: Fix Released → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.