Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2130)

Issue 243610043: balloon-text: robust with empty stencils; issue 4447

Can't Edit
Can't Publish+Mail
Start Review
Created:
8 years, 10 months ago by Keith
Modified:
8 years, 10 months ago
Reviewers:
dak
Visibility:
Public.

Description

balloon-text: robust with empty stencils; issue 4447

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+2 lines, -2 lines) Patch
M lily/balloon.cc View 1 chunk +2 lines, -2 lines 1 comment Download

Messages

Total messages: 3
dak
https://codereview.appspot.com/243610043/diff/1/lily/balloon.cc File lily/balloon.cc (right): https://codereview.appspot.com/243610043/diff/1/lily/balloon.cc#newcode94 lily/balloon.cc:94: b.widen (padding, padding); In general, adding padding around an ...
8 years, 10 months ago (2015-06-20 06:50:50 UTC) #1
Keith
On Fri, 19 Jun 2015 23:50:50 -0700, <dak@gnu.org> wrote: > https://codereview.appspot.com/243610043/diff/1/lily/balloon.cc#newcode94 > lily/balloon.cc:94: b.widen (padding, ...
8 years, 10 months ago (2015-06-21 02:08:13 UTC) #2
dak
8 years, 10 months ago (2015-06-21 05:40:07 UTC) #3
"Keith OHara" <k-ohara5a5a@oco.net> writes:

> On Fri, 19 Jun 2015 23:50:50 -0700, <dak@gnu.org> wrote:
>
>> https://codereview.appspot.com/243610043/diff/1/lily/balloon.cc#newcode94
>> lily/balloon.cc:94: b.widen (padding, padding);
>>
>> Basically we have two options here: not draw a box at all (it would be
>> my guess that this is probably what happened previously when assertions
>> were disabled) or draw a box around the not-with-stencil anchor point.
>
> The former behavior leaked NaNs and corrupted spacing on the whole
> line.

Well, so I guessed wrong.

> This is for the situation where a user, through misunderstanding or
> oversight, requested an indicator box be drawn around an object that
> does not actually appear in print.

That's overinterpreting things.  If I ask for a pointer to the Stem of a
whole note, or the key signature of C major or similar, that does not
mean that this was in error.

The object _has_ a location (or we would not be in this code path) but
no glyph.

> A tiny empty box says clearly "I heard you ask for a box, but I didn't
> recognize or find what you wanted me to draw it around."

A tiny empty box says clearly "here is a point-stencil rather than an
empty one".  If we did not also have the line pointing to the element in
question, not drawing a box would leave the user with no visual
indication at all: I'd agree with your solution then.  But as it is, we
get a visual indication and thus can afford to differentiate between an
empty stencil and a point stencil.  And that distinction can be useful
as they do have significantly different behavior.

Either solution is a substantial improvement over what we have now, and
the code you propose is simple.  I haven't looked at the code in
question: if my proposal for dealing with a non-existing stencil (or
non-existing dimensions) is significantly more complex, I'd just file
another feature request for it.

-- 
David Kastrup
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b