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

Issue 42490046: Because item pure heights are cached, the logic in Accidental_interface::pure_height doesn't work. …

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 4 months ago by MikeSol
Modified:
10 years, 4 months ago
Reviewers:
Keith
CC:
lilypond-devel_gnu.org
Visibility:
Public.

Description

Because item pure heights are cached, the logic in Accidental_interface::pure_height doesn't work. The possibility to have multiple pure height results is eliminated by the caching. This patch adds the property recalculate-pure-height to the Item interface in order to signal that recalculating should be done. Currently, this is only relevant for accidentals but in theory could be used for any item. This way, we can retain the benefits of caching for most items while recalculating pure heights of items whose height changes either with different start and end points or whose estimation gets more accurate over the compilation process.

Patch Set 1 #

Patch Set 2 : Fixes item.cc logic #

Unified diffs Side-by-side diffs Delta from patch set Stats (+11 lines, -2 lines) Patch
M lily/item.cc View 1 2 chunks +6 lines, -2 lines 0 comments Download
M scm/define-grob-properties.scm View 1 chunk +4 lines, -0 lines 0 comments Download
M scm/define-grobs.scm View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 2
MikeSol
Fixes item.cc logic
10 years, 4 months ago (2013-12-23 08:10:23 UTC) #1
Keith
10 years, 4 months ago (2013-12-24 23:29:33 UTC) #2
The drawback is that the glyph for each accidental, rather than being looked up
5 times (already bad) would be looked up 14 times with this patch.

The fundamental problem seems to be that that the 'stencil property is set to
ly:accidental-interface::print(), and that print function checks whether the
accidental is in a tie (unbroken across lines) an deletes the Accidental if so. 
 Thus we cannot store the stencil in 'stencil until we are absolutely sure we
want it.

Could you move the check for ties from accidental::print(), and the similar
check in accidental::pure-height(), to a new function linked to
Accidental.after-line-breaking ?

Then accidentals can build their true stencil just once (whether they need it or
not, but better than building it 14 times throwing away 13) without any 'pure'
complication, and the check for ties (not broken across lines) is linked to a
more expected property, 'after-line-breaking.
Sign in to reply to this message.

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