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

Issue 13341044: Allows inner-markup spacing using skylines.

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

Description

Allows inner-markup spacing using skylines. Uses the stencil skyline drawing method in stencil-integral.cc to provide skyline spacing in Stencil::add_at_edge. Adds corresponding ly module and Scheme functions.

Patch Set 1 #

Total comments: 6

Patch Set 2 : Implements David's suggestions #

Unified diffs Side-by-side diffs Delta from patch set Stats (+81 lines, -11 lines) Patch
A input/regression/markup-skyline.ly View 1 chunk +12 lines, -0 lines 0 comments Download
M lily/accidental.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M lily/include/stencil.hh View 1 2 chunks +3 lines, -2 lines 0 comments Download
M lily/stencil.cc View 1 3 chunks +12 lines, -1 line 0 comments Download
M lily/stencil-integral.cc View 1 4 chunks +31 lines, -3 lines 0 comments Download
M lily/stencil-scheme.cc View 2 chunks +14 lines, -4 lines 0 comments Download
M scm/define-markup-commands.scm View 1 chunk +8 lines, -0 lines 0 comments Download

Messages

Total messages: 5
dak
Where's the point? We don't use that kind of arrangement in our code, and it's ...
10 years, 8 months ago (2013-08-28 21:17:20 UTC) #1
MikeSol
Implements David's suggestions
10 years, 8 months ago (2013-08-29 06:56:20 UTC) #2
MikeSol
The point is to allow users to achieve the same snug skyline spacing between stencils ...
10 years, 8 months ago (2013-08-29 06:57:53 UTC) #3
dak
On 2013/08/29 06:57:53, MikeSol wrote: > The point is to allow users to achieve the ...
10 years, 8 months ago (2013-08-29 08:25:40 UTC) #4
mike7
10 years, 8 months ago (2013-08-29 11:56:08 UTC) #5
On 29 août 2013, at 10:25, dak@gnu.org wrote:

> On 2013/08/29 06:57:53, MikeSol wrote:
>> The point is to allow users to achieve the same snug skyline spacing
> between
>> stencils that is achieved between grobs.
> 
>> I agree that it is inefficient as skylines are never cached, but as it
> is not
>> default beahvior anywhere in the code base, it allows people to decide
> on the
>> efficiency versus snugness-of-placement trade-off.  For people
> creating complex
>> markups, this is useful.
> 
> Mike, the question is not whether or not it is useful to work with the
> distance of skylines.  The problem is that you just pile on complex
> derived functionality nilly-willy without stopping to think what the
> actually sensible building blocks would be.

What would they be?

> 
> 
> The solution is to add _proper_ interfaces to skylines.  Functions
> that can figure out distances and so on.  Between skylines.
> 

Doesn't that exist already with Skyline::distance ?

> And a function to query the skyline(s) of a stencil, yes.
> 

Doesn't this already exist with Stencil::skyline_pair_from_stencil and
Stencil::skyline_from_stencil (proposed in this patch) or the function in
current master Stencil::skylines_from_stencil ?

> Now querying skylines is expensive, so the question is how to cache
> them.

Agreed.

> The important thing to note is that skylines are not actually a
> property of stencils but rather of stencil expressions (combined
> stencils don't actually contain the original stencils but only their
> respective stencil expressions, so caching in the stencils themselves
> does not actually help at all).

If skylines rode around with stencils (like dimensions do), we'd have to do
operations on the skylines when we do operations on the expression and
dimension.

> The current form of stencil
> expressions does not make it easy to tack a skyline cache on without
> changing object identity, so it might be worth considering a different
> representation.

This is certainly a possibility.

> 
> Once that's sorted out satisfactorily and supported by primitives, one
> can stack on uses of skylines.
> 
> But increasing the number of functions that magically and
> intransparently somehow work with skylines not otherwise accessible is
> just a bad idea, and hiding this kind of thing in existing functions
> is even worse.

It would be a good idea to have Scheme bindings for skylines and to make them
accessible, similarly to how dimensions are extensible and changeable.

What is your proposal for a good interface with Skylines?  This patch allows one
to ask LilyPond "find the distance between two stencils' shapes along the
horizontal or vertical axis and move shift a stencil by that amount" and
LilyPond does that.  Where is there transparency needed?  In
side-position-interface.cc and axis-group-interface.cc, the skyline operations
are not transparent (meaning not visible to the user) but the end result (move
object X above or below Y based on the shapes of the objects) is achieved.  It
is also not transparent, but I wouldn't have thought it needed to be - I think
people just want it to work and we should do a good job implementing it cleanly.
 I'm of course open to proposals on how to implement it cleanl.y

Cheers,
MS
Sign in to reply to this message.

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