Circles smaller than grid width not drawn on canvas

Bug #375975 reported by StHiBit
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Medium
Diederik van Lierop

Bug Description

With the 'snap to grid' option activated, it is nevertheless possible to draw a circle smaller than the grid width.
When you drag this circle and try to stamp some copies using the space bar, nothing is shown on the canvas.
Checking the svg file with the XML-editor shows that each stamp has generated a copy as expected, but these elements are not drawn on canvas.
Storing the svg file and reopen it, does not even show the first drawn circle.

Revision history for this message
jazzynico (jazzynico) wrote :

Confirmed on Ubuntu 9.04, Inkscape build 21350.
Works well in 0.46. Tagged "regression".

Changed in inkscape:
importance: Undecided → Medium
milestone: none → 0.47
status: New → Confirmed
tags: added: regression
Revision history for this message
jazzynico (jazzynico) wrote :

Some XML findings:
The created circles (with a size smaller than the grid step) have all sodipodi:rx and sodipodi:ry set to 0. Strangely, the first one is still visible. Resizing it only adds a transform element, but doesn't change rx and ry.

Everything works well if grid snapping is off, or if the circle is larger enough.

tags: added: snapping
Revision history for this message
Diederik van Lierop (mail-diedenrezi) wrote :

Inkscape shouldn't have allowed to create the first circle either, or should it? When drawing a circle, you basically draw a bounding box. If we try to define a circle by specifying two coincident points of a single bounding box (which is what happens when snapping is on and both points snap to the same intersection of two grid lines), then the bounding box will have zero area, and we should have a circle of zero area (and therefore also zero radius), or no circle at all. What do you think?

If you need to draw a circle smaller than the pitch of the grid, then either hide the grid or disable snapping. Otherwise you will get a circle with radius 0, or no circle at all.

Changed in inkscape:
assignee: nobody → Diederik van Lierop (mail-diedenrezi)
Revision history for this message
Diederik van Lierop (mail-diedenrezi) wrote :

When the boundingbox is zero in either of its dimensions then no circle is created any longer. Inkscape just cancels the creation of the circle instead. This also fixes another item of the to-do list, which is making the circle tool escapeable by pressing escape.

Please test revision #21706 or newer. If this works out just fine then this should be copied to other tools (e.g. rect, start, etc; with slight modifications probably).

Changed in inkscape:
status: Confirmed → Fix Released
Revision history for this message
jazzynico (jazzynico) wrote :

Tested on Ubuntu 9.04, rev. 21712.

The circle is no longer created if its radius is smaller than the grid spacing.
But with 0.46, it's possible to create a circle the size we want, snapping activated or not, and thus this new behavior can be seen as a regression.
It's probably not critical. We rarely draw such a tiny shape, and it's possible to turn snapping off if you really want.

Escape key works well. Thanks!

I'm not sure, but I think 0.46 use screen pixels for snapping distance, and 0.47 now use canvas pixel (don't know exactly how to name it:). Is this required by a new 0.47 feature? Could it be the cause of this new behavior?

Revision history for this message
Diederik van Lierop (mail-diedenrezi) wrote : Re: [Bug 375975] Re: Circles smaller than grid width not drawn on canvas

On 06/30/2009 08:35 PM, JazzyNico wrote:
> Tested on Ubuntu 9.04, rev. 21712.
>
> The circle is no longer created if its radius is smaller than the grid spacing.
> But with 0.46, it's possible to create a circle the size we want, snapping activated or not, and thus this new behavior can be seen as a regression.
>

I'd prefer calling this "solving a bug" instead of "introducing a
regression" ;-). When, "always snap" is enabled, which is the default
for grids, then we should really always snap. And if we then snap to the
same point twice, then that's what the user asked for. Drawing a circle
with an arbitrary size anyway was a bug, we should have drawn a
zero-sized circle instead but that's pretty useless and confusing.
> It's probably not critical. We rarely draw such a tiny shape, and it's possible to turn snapping off if you really want.
>

Oh so true!
> Escape key works well. Thanks!
>

I just ran into that while fixing this bug, and this "side-effect" I
think is even more useful than solving the original bug :-)

> I'm not sure, but I think 0.46 use screen pixels for snapping distance,
> and 0.47 now use canvas pixel (don't know exactly how to name it:).
In all cases the snapping distance should be calculated in
screen-pixels, which makes snapping independent of the zoom factor. I
think we shifted to screen-pixels even before v0.46, but I'm not quite
sure about that.

> Is this required by a new 0.47 feature?

No
> Could it be the cause of this new behavior?
Which new behavior are you talking about?

Revision history for this message
jazzynico (jazzynico) wrote :

> I'd prefer calling this "solving a bug" instead of "introducing a
> regression" ;-)

Well, the only regression I see (what I called "new behavior") is the fact that you now can't no longer draw a circle smaller than 1px when snapping is on. But it's exactly the title of the report, and its author do want to draw a small circle... I've tried with 0.46, all snapping options on, maximum zoom and snapping distance set to 50, and I was able to draw a 0.3px radius circle. Now, the minimum radius I can draw is 1px (with a 1px grid, of course). That's the reason why I asked you if something changed in 0.47.
Now I'm in doubt. Is this really a bug? If not, and if this is a wanted behavior, we should change this report to invalid.

Anyway, the new snapping bar and features are great. Thanks for it!

Revision history for this message
Diederik van Lierop (mail-diedenrezi) wrote :

Yeah, the original submitter asked for something and I went the opposite way, that's correct. I think that the current behavior is correct and that the old behavior was wrong, and would like to thank StHiBit for pointing us at this. So please don't change this bug report to invalid, because it has been valuable!

Let's close this, I believer that we are understanding each other perfectly well ;-)

Thank you too!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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