Fix spacing between barlines and accidentals.
Remove unused parameters from spacing functions.
Spacing_options();
void init_from_grob (Grob *me);
- Real get_duration_space (Rational d, bool *) const;
+ Real get_duration_space (Rational d) const;
};
#endif /* SPACING_OPTIONS_HH */
Paper_column *nextr,
Spacing_options const *options);
static Real default_bar_spacing (Grob *, Grob *, Grob *, Moment);
- static Real get_duration_space (Moment dur, Spacing_options const *, bool *);
static Rational effective_shortest_duration (Grob *me, vector<Grob*> const &all);
static void breakable_column_spacing (Grob *, Item *l, Item *r, Spacing_options const *);
static void prune_loose_columns (Grob *, vector<Grob*> *cols, Spacing_options *);
static bool fills_measure (Grob *, Item *, Item *);
public:
static vector<Grob*> get_columns (Grob *me);
- static Real note_spacing (Grob *, Grob *, Grob *, Spacing_options const *, bool *);
+ static Real note_spacing (Grob *, Grob *, Grob *, Spacing_options const *);
static void standard_breakable_column_spacing (Grob *me, Item *l, Item *r,
Real *fixed, Real *space,
Spacing_options const *);
*space = *fixed + 0.5;
}
else
- {
- bool dummy;
- *space = *fixed + options->get_duration_space (dt.main_part_, &dummy);
- }
+ *space = *fixed + options->get_duration_space (dt.main_part_);
}
}
Real
Spacing_spanner::note_spacing (Grob *me, Grob *lc, Grob *rc,
- Spacing_options const *options,
- bool *expand_only)
+ Spacing_options const *options)
{
(void) me;
Real dist = 0.0;
if (delta_t.main_part_ && !lwhen.grace_part_)
{
- dist = options->get_duration_space (shortest_playing_len.main_part_,
- expand_only);
+ dist = options->get_duration_space (shortest_playing_len.main_part_);
dist *= double (delta_t.main_part_ / shortest_playing_len.main_part_);
}
else if (delta_t.grace_part_)
available (namely the space for the global shortest note), and
multiply that by grace-space-factor
*/
- dist = options->get_duration_space (options->global_shortest_, expand_only) / 2.0;
+ dist = options->get_duration_space (options->global_shortest_) / 2.0;
Grob *grace_spacing = unsmob_grob (lc->get_object ("grace-spacing"));
if (grace_spacing)
{
Spacing_options grace_opts;
grace_opts.init_from_grob (grace_spacing);
- bool bla;
- dist = grace_opts.get_duration_space (delta_t.grace_part_, &bla);
+ dist = grace_opts.get_duration_space (delta_t.grace_part_);
}
}
*/
Real space = 0.0;
Real fixed = 0.0;
- bool dummy = false;
- Real base = note_spacing (me, lc, rc, options, &dummy);
+ Real base = note_spacing (me, lc, rc, options);
Note_spacing::get_spacing (sp, rc, base, options->increment_,
&space, &fixed);
else
programming_error ("Column without spacing object");
- bool expand_only = false;
Real base_note_space = 0.0;
if (Paper_column::is_musical (next_col)
&& Paper_column::is_musical (loose_col))
- base_note_space = Spacing_spanner::note_spacing (spacing, loose_col, next_col,
- &options, &expand_only);
+ base_note_space = Spacing_spanner::note_spacing (spacing, loose_col, next_col,
+ &options);
else
{
Real fixed, space;
Get the measure wide ant for arithmetic spacing.
*/
Real
-Spacing_options::get_duration_space (Rational d,
- bool *expand_only) const
+Spacing_options::get_duration_space (Rational d) const
{
Real k = shortest_duration_space_;
*/
Real log = log_2 (global_shortest_);
k -= log;
- *expand_only = false;
return (log_2 (d) + k) * increment_;
}
{
if (Paper_column::is_musical (left_col))
{
- bool skip_unbroken_right = false;
-
if (!Paper_column::is_musical (right_col)
&& options->float_nonmusical_columns_
&& after_right_col
&& Paper_column::is_musical (after_right_col))
- skip_unbroken_right = true;
-
- if (skip_unbroken_right)
{
/*
TODO: should generate rods to prevent collisions.
}
/*
- Generate the space between two musical columns LEFT_COL and RIGHT_COL, given
- spacing parameters INCR and SHORTEST.
+ Generate the space between two musical columns LEFT_COL and RIGHT_COL.
*/
void
Spacing_spanner::musical_column_spacing (Grob *me,
Item *right_col,
Spacing_options const *options)
{
- bool expand_only = false;
- Real base_note_space = note_spacing (me, left_col, right_col, options, &expand_only);
+ Real base_note_space = note_spacing (me, left_col, right_col, options);
Real max_fixed = 0;
Real max_space = 0;
if (bar_size.is_empty ())
left_stickout_correction *= 0.75;
- /*
- We want 0.3 ss before the sticking-out object.
-
- current_fixed/2 is our guess at (right side of left object + 0.3)
- */
- left_stickout_correction += current_fixed/2 - current_space;
- left_stickout_correction = max (left_stickout_correction, 0.0);
-
-
Real optical_corr = 0.0;
Grob *stem = Note_column::get_stem (g);
if (!bar_size.is_empty ()
)
{
Interval bar_size = bar_y_positions (last_grob);
+ Grob *orig = me->original () ? me->original () : me;
- extract_grob_set (me, "right-items", right_items);
+ extract_grob_set (orig, "right-items", right_items);
*compound_fixed = 0.0;
*compound_space = 0.0;