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

Issue 7533046: Don't report a programming error when trying to align grob with an empty extent (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years ago by janek
Modified:
12 years ago
Reviewers:
pkx166h, MikeSol, dak, Trevor Daniels, t.daniels
CC:
lilypond-devel_gnu.org
Visibility:
Public.

Description

Don't report a programming error when trying to align grob with an empty extent If a grob's extent is empty (undefined), alignment procedures from Self_alignment_interface don't have any information about grob's dimensions, so they cannot calculate the offset required to achieve specified alignment of such grob. However, this isn't actually a problem: if a grob's extent is empty, this usually means that the grob itself is empty, and in that case there is nothing to align at all. Therefore, no programming error should be reported. For example, a user may remove some grob from output by overriding its stencil to #f. This will result in an empty extent, and Lily shouldn't complain about being unable to align such grob, because there is nothing to align.

Patch Set 1 #

Patch Set 2 : report a programming error when trying to align on empty self #

Total comments: 2

Patch Set 3 : Don't report a programming error #

Total comments: 2

Patch Set 4 : reword and move comment according to Trevor #

Patch Set 5 : add a waning when stencil isn't empty.\ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+13 lines, -3 lines) Patch
M lily/self-alignment-interface.cc View 1 2 3 4 2 chunks +13 lines, -3 lines 0 comments Download

Messages

Total messages: 20
janek
This is the part of Issue 3239 that introduced additional programming errors. I hope that ...
12 years ago (2013-03-18 14:18:34 UTC) #1
janek
report a programming error when trying to align on empty self
12 years ago (2013-03-18 16:48:36 UTC) #2
MikeSol
LGTM
12 years ago (2013-03-19 15:14:49 UTC) #3
dak
https://codereview.appspot.com/7533046/diff/3001/lily/self-alignment-interface.cc File lily/self-alignment-interface.cc (right): https://codereview.appspot.com/7533046/diff/3001/lily/self-alignment-interface.cc#newcode63 lily/self-alignment-interface.cc:63: programming_error ("cannot align on self: empty element"); "cannot align ...
12 years ago (2013-03-21 06:57:46 UTC) #4
janek
Thanks for review! https://codereview.appspot.com/7533046/diff/3001/lily/self-alignment-interface.cc File lily/self-alignment-interface.cc (right): https://codereview.appspot.com/7533046/diff/3001/lily/self-alignment-interface.cc#newcode63 lily/self-alignment-interface.cc:63: programming_error ("cannot align on self: empty ...
12 years ago (2013-03-21 08:04:42 UTC) #5
dak
On 2013/03/21 08:04:42, janek wrote: > So, you think that we shouldn't report any programming ...
12 years ago (2013-03-21 08:14:51 UTC) #6
janek
On Thu, Mar 21, 2013 at 9:14 AM, <dak@gnu.org> wrote: > On 2013/03/21 08:04:42, janek ...
12 years ago (2013-03-21 12:22:00 UTC) #7
dak
Janek Warchoł <janek.lilypond@gmail.com> writes: > On Thu, Mar 21, 2013 at 9:14 AM, <dak@gnu.org> wrote: ...
12 years ago (2013-03-21 12:37:50 UTC) #8
janek
On Thu, Mar 21, 2013 at 1:21 PM, Janek Warchoł <janek.lilypond@gmail.com> wrote: > On Thu, ...
12 years ago (2013-03-23 15:44:02 UTC) #9
t.daniels_treda.co.uk
janek.lilypond@gmail.com wrote Saturday, March 23, 2013 3:44 PM > If i got everything right, you'll ...
12 years ago (2013-03-23 16:38:21 UTC) #10
janek
Don't report a programming error
12 years ago (2013-03-24 11:22:08 UTC) #11
janek
On 2013/03/23 16:38:21, t.daniels_treda.co.uk wrote: > A 'programming error' should be issued only when an ...
12 years ago (2013-03-24 11:26:16 UTC) #12
Trevor Daniels
I was a little concerned that problems might result when a non-empty stencil was given ...
12 years ago (2013-03-24 12:37:14 UTC) #13
dak
On 2013/03/24 12:37:14, Trevor Daniels wrote: > I was a little concerned that problems might ...
12 years ago (2013-03-24 12:45:38 UTC) #14
janek
On 2013/03/24 12:45:38, dak wrote: > On 2013/03/24 12:37:14, Trevor Daniels wrote: > > I ...
12 years ago (2013-03-24 14:26:36 UTC) #15
janek
reword and move comment according to Trevor
12 years ago (2013-03-24 14:27:19 UTC) #16
janek
add a waning when stencil isn't empty.\
12 years ago (2013-03-24 15:00:39 UTC) #17
janek
On 2013/03/24 12:45:38, dak wrote: > On 2013/03/24 12:37:14, Trevor Daniels wrote: > > I ...
12 years ago (2013-03-24 15:09:05 UTC) #18
Trevor Daniels
> Patchset 5 warns the user when the extent is empty and stencil isn't. > ...
12 years ago (2013-03-24 16:39:03 UTC) #19
janek
12 years ago (2013-03-26 21:49:40 UTC) #20
On 2013/03/24 16:39:03, Trevor Daniels wrote:
>
> > Please choose between patchsets 4 and 5.
> 
> I prefer 5.  The warning does no harm if it is
> never triggered, but is there in case some future
> change elsewhere assumes a non-empty stencil will
> be aligned even if its extent is empty.  It is
> relevant to these alignment routines as they cannot
> calculate the offset required to achieve the specified
> alignment of such grobs, so should warn if a caller
> appears to be expecting them to do that.

Aaaand the winner is... patchset 5!
Seriously though, Trevor's argument convinced me.

pushed as 1656075e24330067ff1dfa4d8253e5f3e5783014, closed.
Sign in to reply to this message.

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