[gsharp-cvs] CVS update: gsharp/drawing.lisp
Robert Strandh
rstrandh at common-lisp.net
Tue Dec 6 16:36:04 UTC 2005
Update of /project/gsharp/cvsroot/gsharp
In directory common-lisp.net:/tmp/cvs-serv6462
Modified Files:
drawing.lisp
Log Message:
Improved the calculation of the left and right bulge for clusters with
suspended notes.
Date: Tue Dec 6 17:36:03 2005
Author: rstrandh
Index: gsharp/drawing.lisp
diff -u gsharp/drawing.lisp:1.50 gsharp/drawing.lisp:1.51
--- gsharp/drawing.lisp:1.50 Mon Dec 5 06:53:30 2005
+++ gsharp/drawing.lisp Tue Dec 6 17:36:03 2005
@@ -161,9 +161,13 @@
(/ (text-size pane (map 'string 'code-char (text element))) 2)))
(defmethod left-bulge ((element cluster) pane)
- (+ (- (loop for note in (notes element)
- when (final-accidental note)
- minimize (final-relative-accidental-xoffset note)))
+ (+ (max (- (loop for note in (notes element)
+ when (final-accidental note)
+ minimize (final-relative-accidental-xoffset note)))
+ (if (and (eq (final-stem-direction element) :down)
+ (element-has-suspended-notes element))
+ (score-pane:staff-step 3)
+ (score-pane:staff-step 0)))
(score-pane:staff-step 2)))
(defmethod right-bulge ((element element) pane)
@@ -174,7 +178,10 @@
(/ (text-size pane (map 'string 'code-char (text element))) 2)))
(defmethod right-bulge ((element cluster) pane)
- (score-pane:staff-step 2))
+ (if (and (eq (final-stem-direction element) :up)
+ (element-has-suspended-notes element))
+ (score-pane:staff-step 5)
+ (score-pane:staff-step 2)))
;;; As it turns out, the spacing algorithm would be very complicated
;;; if we were to take into account exactly how elements with
More information about the Gsharp-cvs
mailing list