From: Han-Wen Nienhuys Date: Mon, 17 Jun 2002 16:46:30 +0000 (+0000) Subject: fluffhouse X-Git-Tag: release/1.5.62~13 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=ae939e9a972d20f0c16d136a992f92c0daebb276;p=lilypond.git fluffhouse --- diff --git a/ChangeLog b/ChangeLog index 75789d5973..ab0f437ee5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2002-06-17 Chris Jackson + + * lily/tuplet-bracket.cc: + * lily/text-spanner.cc: + * lily/piano-pedal-engraver.cc: + * scm/grob-description.scm: + * scm/grob-property-description.scm: Changed the + edge-width property of brackets to edge-widen. Changed the sign of + the left element of edge-widen so a pair of equal numbers produces + a symmetrical bracket. + 2002-06-17 Han-Wen Nienhuys * ly/espanol.ly: added. diff --git a/lily/include/tuplet-bracket.hh b/lily/include/tuplet-bracket.hh index dc301fa05e..8dbc232184 100644 --- a/lily/include/tuplet-bracket.hh +++ b/lily/include/tuplet-bracket.hh @@ -32,10 +32,9 @@ public: DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM )); static Molecule make_bracket (Axis protusion_axis, - Real dx, Real dy, Real thick, Real left_height, - Real right_height, Real gap, Real left_widen, - Real right_widen, Real left_shorten, - Real right_shorten); + Real dx, Real dy, Real thick, Drul_array height, + Real gap, Drul_array widen, + Drul_array shorten); static Direction get_default_dir (Grob*); }; diff --git a/lily/piano-pedal-engraver.cc b/lily/piano-pedal-engraver.cc index 5af7b0e4b2..f754b7481d 100644 --- a/lily/piano-pedal-engraver.cc +++ b/lily/piano-pedal-engraver.cc @@ -72,7 +72,7 @@ private: /* Left and right flare widths of a \___/, as specified by the grob - property edge-width. + property edge-widen. */ Drul_array edge_width_drul_; @@ -310,9 +310,9 @@ Piano_pedal_engraver::create_bracket_grobs (Pedal_info *p, SCM pedaltype) Set properties so that the molecule-creating function will know whether the right edge should be flared ___/ */ - SCM eleft = ly_car (p->bracket_p_->get_grob_property ("edge-width")); + SCM eleft = ly_car (p->bracket_p_->get_grob_property ("edge-widen")); SCM eright = (p->req_l_drul_[START] ? edge_width_drul_[RIGHT] : gh_double2scm (0)); - p->bracket_p_->set_grob_property ("edge-width", gh_cons (eleft, eright)); + p->bracket_p_->set_grob_property ("edge-widen", gh_cons (eleft, eright)); p->finished_bracket_p_ = p->bracket_p_; p->bracket_p_ = 0; @@ -332,7 +332,7 @@ Piano_pedal_engraver::create_bracket_grobs (Pedal_info *p, SCM pedaltype) know whether the left edge should be flared \___ */ - SCM ew = p->bracket_p_->get_grob_property ("edge-width"); + SCM ew = p->bracket_p_->get_grob_property ("edge-widen"); edge_width_drul_[LEFT] = ly_car (ew); edge_width_drul_[RIGHT] = ly_cdr (ew); @@ -340,7 +340,7 @@ Piano_pedal_engraver::create_bracket_grobs (Pedal_info *p, SCM pedaltype) edge_width_drul_[LEFT] : gh_double2scm (0)); SCM eright = gh_double2scm (0); - p->bracket_p_->set_grob_property ("edge-width", gh_cons (eleft, eright)); + p->bracket_p_->set_grob_property ("edge-widen", gh_cons (eleft, eright)); /* Set this property for 'mixed style' pedals, Ped._______/\ , so the molecule function will shorten the ____ line by the length of the Ped. text. diff --git a/lily/text-spanner.cc b/lily/text-spanner.cc index fbefe9911b..f4ab3b5247 100644 --- a/lily/text-spanner.cc +++ b/lily/text-spanner.cc @@ -144,7 +144,7 @@ Text_spanner::brew_molecule (SCM smob) Drul_array edge_line; s = me->get_grob_property ("edge-height"); - SCM ew = me->get_grob_property ("edge-width"); + SCM ew = me->get_grob_property ("edge-widen"); if (gh_pair_p (s)) { Direction d = LEFT; @@ -152,7 +152,7 @@ Text_spanner::brew_molecule (SCM smob) do { Real dx = ( gh_pair_p (ew) ? - gh_scm2double (index_cell (ew, d)) * - dir : + gh_scm2double (index_cell (ew, d)) * d : 0 ); Real dy = gh_scm2double (index_cell (s, d)) * - dir; if (dy) @@ -206,7 +206,7 @@ Text_spanner::setup_pedal_bracket(Spanner *me) Drul_array height, width, shorten, r; SCM pa = me->get_grob_property ("if-text-padding"); - SCM ew = me->get_grob_property ("edge-width"); + SCM ew = me->get_grob_property ("edge-widen"); SCM eh = me->get_grob_property ("edge-height"); SCM sp = me->get_grob_property ("shorten-pair"); @@ -230,7 +230,7 @@ Text_spanner::setup_pedal_bracket(Spanner *me) height[d] = 0; shorten[d] = 0; if ( ly_number_pair_p (ew) ) - width[d] += gh_scm2double (index_cell (ew, d)) * d; + width[d] += gh_scm2double (index_cell (ew, d)); if ( !broken[d] && (ly_number_pair_p (eh) ) ) height[d] += gh_scm2double (index_cell (eh, d)); if ( ly_number_pair_p (sp) ) @@ -276,7 +276,7 @@ Text_spanner::setup_pedal_bracket(Spanner *me) } me->set_grob_property ("edge-height", ly_interval2scm (height)); - me->set_grob_property ("edge-width", ly_interval2scm(width)); + me->set_grob_property ("edge-widen", ly_interval2scm(width)); me->set_grob_property ("shorten-pair", ly_interval2scm (shorten)); } @@ -287,9 +287,9 @@ struct Pianopedal }; ADD_INTERFACE (Pianopedal,"piano-pedal-interface", "", - "pedal-type edge-width edge-height shorten-pair text-start left-widen right-widen"); + "pedal-type edge-widen edge-height shorten-pair text-start left-widen right-widen"); ADD_INTERFACE (Text_spanner,"text-spanner-interface", "generic text spanner", - "dash-period if-text-padding dash-length edge-height edge-width edge-text shorten-pair type"); + "dash-period if-text-padding dash-length edge-height edge-widen edge-text shorten-pair type"); diff --git a/lily/tuplet-bracket.cc b/lily/tuplet-bracket.cc index b1c70bff62..e458287cc7 100644 --- a/lily/tuplet-bracket.cc +++ b/lily/tuplet-bracket.cc @@ -163,7 +163,7 @@ Tuplet_bracket::brew_molecule (SCM smob) lt *= gh_scm2double (thick); SCM gap = me->get_grob_property ("gap"); - SCM ew = me->get_grob_property ("edge-width"); + SCM ew = me->get_grob_property ("edge-widen"); SCM eh = me->get_grob_property ("edge-height"); SCM sp = me->get_grob_property ("shorten-pair"); @@ -172,9 +172,9 @@ Tuplet_bracket::brew_molecule (SCM smob) do { width[d] = height[d] = shorten[d] = 0.0; if ( ly_number_pair_p (ew) ) - width[d] += gh_scm2double (index_cell (ew, d)) * d; + width[d] += gh_scm2double (index_cell (ew, d)); if ( ly_number_pair_p (eh) ) - height[d] += gh_scm2double (index_cell (eh, d)); + height[d] += gh_scm2double (index_cell (eh, d)) * - dir; if ( ly_number_pair_p (sp) ) shorten[d] += gh_scm2double (index_cell (sp, d)); } @@ -182,10 +182,10 @@ Tuplet_bracket::brew_molecule (SCM smob) Molecule brack = make_bracket (Y_AXIS, w, ry - ly, lt, - -height[LEFT]*dir, -height[RIGHT]*dir, + height, gh_scm2double (gap), - width[LEFT], width[RIGHT], - shorten[LEFT], shorten[RIGHT]); + width, + shorten); mol.add_molecule (brack); } @@ -196,46 +196,43 @@ Tuplet_bracket::brew_molecule (SCM smob) /* should move to lookup? - - argh. this interface is confusing : we have a shorten as well as a - widen. - - arg. should use drul_arrays here. */ Molecule Tuplet_bracket::make_bracket (Axis protusion_axis, - Real dx, Real dy, Real thick, Real left_height, - Real right_height, + Real dx, Real dy, Real thick, Drul_array height, Real gap, - Real left_widen, Real right_widen, - Real left_shorten, Real right_shorten) + Drul_array widen, + Drul_array shorten) { Real len = Offset (dx,dy).length (); Real gapx = dx * (gap / len); Real gapy = dy * (gap / len); - Real lshortx = dx * (left_shorten / len); - Real lshorty = dy * (left_shorten / len); - Real rshortx = dx * (right_shorten / len); - Real rshorty = dy * (right_shorten / len); + Drul_array shortx, shorty; + Direction d = LEFT; + do { + shortx[d] = dx * (shorten[d] / len); + shorty[d] = dy * (shorten[d] / len); + } + while (flip (&d) != LEFT); Axis other = other_axis (protusion_axis); - Molecule l1 = Lookup::line (thick, Offset(lshortx, lshorty), + Molecule l1 = Lookup::line (thick, Offset(shortx[LEFT], shorty[LEFT]), Offset ( (dx - gapx)/2, (dy - gapy)/2 )); Molecule l2 = Lookup::line (thick, Offset((dx + gapx) / 2,(dy + gapy) / 2), - Offset (dx - rshortx, dy - rshorty)); + Offset (dx - shortx[RIGHT], dy - shorty[RIGHT])); Offset protusion; - protusion[other] = -left_widen; - protusion[protusion_axis] = left_height; + protusion[other] = -widen[LEFT]; + protusion[protusion_axis] = height[LEFT]; Molecule p1 = Lookup::line (thick, - Offset(lshortx, lshorty), - Offset(lshortx, lshorty) + protusion); - protusion[other] = right_widen; - protusion[protusion_axis] = right_height; + Offset(shortx[LEFT], shorty[LEFT]), + Offset(shortx[LEFT], shorty[LEFT]) + protusion); + protusion[other] = widen[RIGHT]; + protusion[protusion_axis] = height[RIGHT]; Molecule p2 = Lookup::line (thick, - Offset(dx - rshortx, dy - rshorty), - Offset(dx - rshortx, dy - rshorty) + protusion); + Offset(dx - shortx[RIGHT], dy - shorty[RIGHT]), + Offset(dx - shortx[RIGHT], dy - shorty[RIGHT]) + protusion); Molecule m; m.add_molecule (p1); @@ -489,5 +486,5 @@ Tuplet_bracket::add_column (Grob*me, Item*n) ADD_INTERFACE (Tuplet_bracket,"tuplet-bracket-interface", "A bracket with a number in the middle, used for tuplets.", - "note-columns edge-width edge-height shorten-pair padding gap left-position right-position bracket-visibility number-visibility thickness direction"); + "note-columns edge-widen edge-height shorten-pair padding gap left-position right-position bracket-visibility number-visibility thickness direction"); diff --git a/scm/grob-description.scm b/scm/grob-description.scm index b5443afc47..8e10acd595 100644 --- a/scm/grob-description.scm +++ b/scm/grob-description.scm @@ -625,7 +625,7 @@ (width-correct . 0) (outer . #t) (direction . -1) - (edge-width . (0.5 . 0.5)) + (edge-widen . (0.5 . 0.5)) (edge-height . (1.0 . 1.0)) (shorten-pair . (0.0 . 0.0)) (thickness . 1.0) @@ -975,7 +975,7 @@ (gap . 2.0) (padding . 0.9) (thickness . 1.6) - (edge-width . (0.0 . 0.0)) + (edge-widen . (0.0 . 0.0)) (edge-height . (0.7 . 0.7)) (shorten-pair . (-0.2 . -0.2)) (before-line-breaking-callback . ,Tuplet_bracket::before_line_breaking) diff --git a/scm/grob-property-description.scm b/scm/grob-property-description.scm index c878c0cdcf..d8d36e5467 100644 --- a/scm/grob-property-description.scm +++ b/scm/grob-property-description.scm @@ -133,7 +133,7 @@ mean centre distance weighted per note (grob-property-description 'dot-count integer? "number of dots.") (grob-property-description 'duration-log integer? "2-log of the notehead duration, i.e. 0=whole note, 1 = half note, etc.") (grob-property-description 'edge-height pair? "a cons that specifies the heights of the vertical edges '(LEFT-height . RIGHT-height).") -(grob-property-description 'edge-width pair? "a cons that specifies the widths of the slanted edges '(LEFT-width . RIGHT-width).") +(grob-property-description 'edge-widen pair? "a cons that specifies the widths of the slanted edges '(LEFT-width . RIGHT-width).") (grob-property-description 'edge-text pair? "a cons that specifies the texts to be set at the edges '(LEFT-text . RIGHT-text).") (grob-property-description 'elements list? "list of grobs, type depending on the Grob where this is set in.") (grob-property-description 'expand-limit integer? "maximum number of measures expanded in church rests.") @@ -204,7 +204,7 @@ For barline, space after a thick line.") (grob-property-description 'right-head ly-grob? "") (grob-property-description 'left-head ly-grob? "") -(grob-property-description 'left-widen boolean? "Whether the left edge of a piano pedal bracket should be widened by the first element of edge-width.") +(grob-property-description 'left-widen boolean? "Whether the left edge of a piano pedal bracket should be widened by the first element of edge-widen.") (grob-property-description 'length number? "Stem length for unbeamed stems, only for user override.") (grob-property-description 'lengths list? "Stem length given multiplicity of flag.") @@ -278,7 +278,7 @@ as a real penalty.") (grob-property-description 'raise number? "height for text to be raised (a negative value lowers the text.") (grob-property-description 'right-padding number? "space right of accs.") (grob-property-description 'right-trim-amount number? "shortening of the lyric extender on the right.") -(grob-property-description 'right-widen boolean? "Whether the right edge of a piano pedal bracket should be widened by the second element of edge-width") +(grob-property-description 'right-widen boolean? "Whether the right edge of a piano pedal bracket should be widened by the second element of edge-widen") (grob-property-description 'script-priority number? "A sorting key that determines in what order a script is within a stack of scripts.") (grob-property-description 'self-alignment-X number-or-grob? "real number: -1 = left aligned, 0 = center, 1 right-aligned in X direction.