lilypond-auto
[Top][All Lists]

## [Lilypond-auto] [LilyIssues-auto] [testlilyissues:issues] #5307 Skyline

 From: Auto mailings of changes to Lily Issues via Testlilyissues-auto Subject: [Lilypond-auto] [LilyIssues-auto] [testlilyissues:issues] #5307 Skyline Refinements (Rounded Boxes and Rotated Ellipses) Date: Fri, 20 Apr 2018 16:47:53 -0000

# (2) Simple Boxes

Admittedly, the vast majority of boxes is neither rotated nor has it rounded corners with considerable radius. The most prominent example of round filled boxes probably are ledger lines.

Therefore, I consider it important to keep the simple cases simple.

• It's very easy to see whether there is some rotation involved by looking at the trans.yx and trans.xy values of the transformation matrix trans. As soon as they are not 0, there is some rotation going on.
• Only if the larger of the two (scaled) corner diameters is greater than half a staff space, the skyline corners are considered to be "rounded", otherewise an edgy skyline box will do.

Consequences
A Ledger line skyline (standard corner diameter 0.2 staff spaces) are still drawn as one single box.

Where does the "extra margin" come from?
The "extra margin" around rounded boxes that messed up spacing is caused by a misunderstanding:
Rounded boxes are defined by their total width (left, right), their total height (bottom, top), and the diameter of the corner circles.
In the current inmplementation, the diameter of the corner circles has been misinterpreted as a line thickness (variable th) and therefore, half of it is added around the box. This is particularly obvious for \rounded-box markups (and less for comparatively tiny ledger lines).

Attachments:

[issues:#5307] Skyline Refinements (Rounded Boxes and Rotated Ellipses)

Status: Started
Labels: re
Created: Sun Apr 15, 2018 09:46 PM UTC by Torsten Hämmerle
Last Updated: Fri Apr 20, 2018 03:12 PM UTC
Owner: Torsten Hämmerle
Attachments:

Recently, there have been some discussions about mysterious spacing of \rounded-box markup.

Harm identified skyline problems as the cause and submitted the following bug report:
Possible regression with box-markup/rounded-box-markup
Before Mike Solomon's new skyline handling, there were no such uninteded extra margins.

# Rounded Box Skylines

The skyline of boxes with rounded corners do not tightly wrap the boxes but there's an unintentional margin (as wide as the corner radius).

Apart from that here are a few other shortcomings and so I have decided to create a more general box-and-rotated-ellipses skyline issue.

# Other issues

When working on this case, I came across a few other things that call for improvement and so I've included them into the test file. Most notably, there is a general problem with rotation. And it would be nice to recreate the rounded corners for large boxes/radii.
At the same time, one should keep run-of-the-mill stuff like ledger lines as simple and fast as possible.

# Test file

A file with 'debug-skylines switched on and TextScript padding values set to 0 in order to be able to check how the markup objects are fitted together.
I have tried to demonstrate about everything you cold do with boxes (including scaling, rotating, cominations thereof).

```#(ly:set-option 'debug-skylines #t)

{
\set Staff.instrumentName = \markup #(lilypond-version)
\override Staff.TextScript.self-alignment-X = #CENTER
\override Staff.TextScript.layer = 0
f'''4
c'' ^\markup \override #'(thickness . 4) \box \teeny 1
_\markup \with-color #grey \filled-box #'(-1 . 4) #'(1 . 4) #1
b'  ^\markup \rounded-box "2!" ^\markup \rounded-box "3"
d'' ^\markup \circle "*" ^\markup \rotate #90 \ellipse "Elli"
_\markup \with-color #grey \rotate #10 \filled-box #'(-2 . 5) #'(1 . 4) #10
_ \markup \rotate #36 \override #'(corner-radius . 20) \scale #'(1 . 0.4)
\rotate #-68 \scale #'(1.6 . 1) \rounded-box "dop"
f'' _\markup \override #'(corner-radius . 0.5) \rounded-box "."
a'  ^\markup \rotate #30 \rounded-box "rotated a"
_\markup \scale #'(1 . 1.5) \rotate #45 \override #'(thickness . 5)
\rounded-box \rotate #-45 \scale #'(2 . 1) \bold "!"
d'' _\markup \override #'(corner-radius . 20) \rounded-box "4"
a'' ^\markup \rotate #-165 \box "rotated b"
_\markup \rotate #180 \override #'(corner-radius . 20) \rounded-box \teeny
\override #'(baseline-skip . 0) \center-column { "Upside" "Down" }
}
```

(see attached PNG file)

• Ledger lines are filled rounded boxes, too (!)
• Corner radius is misinterpreted as line thickness and padded around the box.
• Ledger lines have rounded corners, but the blot diameter is so small that the effect didn't disturb too much.
• When rotating boxes, the skylines still consist of one single non-rotated rectangular box.
• Rounded corners are not replicated in the skylines, even if this may be beneficial for bigger radii.
• Ellipse skylines gradually deteriorate when being rotated. In the example, the skyline of ellipse "Elli" has completely collapsed because of the 90° rotation.
• The rhombus "!" has been created by rotating and scaling that unfortunately caused a collapse of the skyline.
• Rotations in general cause large skyline boxes that hamper object placement a lot.

Sent from sourceforge.net because address@hidden is subscribed to https://sourceforge.net/p/testlilyissues/issues/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/testlilyissues/admin/issues/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.

```------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
```_______________________________________________