lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

issue #5341: Urgent corrections to stencil-integral.cc (skylines) (issue


From: torsten . haemmerle
Subject: issue #5341: Urgent corrections to stencil-integral.cc (skylines) (issue 341350043 by address@hidden)
Date: Mon, 11 Jun 2018 10:20:47 -0700

Reviewers: ,

Message:
Please review (ideally DAK)

Thanks,
Torsten


Description:
issue #5341: Urgent corrections to stencil-integral.cc (skylines)

modified:   ../lily/stencil-integral.cc

Main correction:
Stencil::skylines_from_stencil
Avoid garbage collection by introducing an SCM variable new_s.

Minor changes:
make_round_filled_boxes
line 393: increasing step width in order to skip unneccessary straight
lines.
line 432: replacing a < by a clearer <=

Please review this at https://codereview.appspot.com/341350043/

Affected files (+4, -3 lines):
  M lily/stencil-integral.cc


Index: lily/stencil-integral.cc
diff --git a/lily/stencil-integral.cc b/lily/stencil-integral.cc
index bc2bc2b41d363166d77b5bca97d67090f1bbb9b4..7af58d00d3004107887de7f808b42adab957c4bf 100644
--- a/lily/stencil-integral.cc
+++ b/lily/stencil-integral.cc
@@ -390,7 +390,7 @@ make_round_filled_box_boxes (vector<Box> &boxes,
       points.push_back (Offset (-left + radius, top));
       points.push_back (Offset (right - radius, top));

-      for (vsize i = 0; i < (vsize) points.size () - 1; i++)
+      for (vsize i = 0; i < (vsize) points.size () - 1; i+=2)
         {
           Offset p0 = points[i];
           Offset p1 = points[i+1];
@@ -420,7 +420,7 @@ make_round_filled_box_boxes (vector<Box> &boxes,
           cy[DOWN]  = -bottom + radius;
           cy[UP]    = top - radius;

-          for (vsize i = 0; i < (vsize) quantization + 1; i++)
+          for (vsize i = 0; i <= (vsize) quantization; i++)
             for (DOWN_and_UP(v))
               for (LEFT_and_RIGHT(h))
                 {
@@ -1129,7 +1129,8 @@ Stencil::skylines_from_stencil (SCM sten, Real pad, SCM rot, Axis a)
       Real x = robust_scm2double (scm_cadr (rot), 0.0);
       Real y = robust_scm2double (scm_caddr (rot), 0.0);
       /* pass over a rotated copy of the stencil */
-      Stencil *q = unsmob<Stencil> (s->smobbed_copy ());
+      SCM new_s = s->smobbed_copy ();
+      Stencil *q = unsmob<Stencil> (new_s);
       q->rotate_degrees (angle, Offset (x, y));
       data = stencil_traverser
                (make_transform_matrix (1.0, 0.0, 0.0, 1.0, 0.0, 0.0),





reply via email to

[Prev in Thread] Current Thread [Next in Thread]