[gsharp-cvs] CVS update: gsharp/drawing.lisp gsharp/gui.lisp

Robert Strandh rstrandh at common-lisp.net
Mon Dec 5 03:27:28 UTC 2005


Update of /project/gsharp/cvsroot/gsharp
In directory common-lisp.net:/tmp/cvs-serv31254

Modified Files:
	drawing.lisp gui.lisp 
Log Message:
Final (?) step in separating coordinate computation and drawing.

Date: Mon Dec  5 04:27:27 2005
Author: rstrandh

Index: gsharp/drawing.lisp
diff -u gsharp/drawing.lisp:1.46 gsharp/drawing.lisp:1.47
--- gsharp/drawing.lisp:1.46	Mon Dec  5 03:59:21 2005
+++ gsharp/drawing.lisp	Mon Dec  5 04:27:26 2005
@@ -294,9 +294,9 @@
 		 finally (setf (elasticity-function measure) result)))
   (reduce #'add-elasticities measures :key #'elasticity-function))
 
-;;; eventually remove the existing draw-measure and rename this
-;;; to draw-measure
-(defun new-draw-measure (pane measure x force)
+;;; eventually replace the existing compute-measure-coordinates
+;;; by this one
+(defun new-compute-measure-coordinates (measure x force)
   (loop with timelines = (timelines measure)
 	for i from 0 below (flexichain:nb-elements timelines)
 	for timeline = (flexichain:element* timelines i)
@@ -306,9 +306,7 @@
         do (loop for element in (elements timeline)
 		 do (setf (final-absolute-element-xoffset element) xx)))
   (loop for bar in (measure-bars measure)
-	do (if (gsharp-cursor::cursors (slice bar))
-	      (new-draw-bar pane bar)
-	      (score-pane:with-light-glyphs pane (new-draw-bar pane bar)))))
+	do (compute-bar-coordinates bar x (size-at-force (elasticity-function measure) force))))
 
 (defun compute-measure-coordinates (measure min-dist compress x y method)
   (let* ((width (/ (nat-width method (measure-coeff measure) min-dist)
@@ -345,15 +343,12 @@
 			      (+ y (- (score-pane:staff-step 8)))
 			      (+ y (staff-yoffset (car (last staves)))))))
 
-;;; eventually remove the existing draw-system and rename this
-;;; to draw-system
-(defun new-draw-system (pane measures x force staves)
+;;; eventually remove the existing compute-system-coordinates
+;;; and rename this one
+(defun new-compute-system-coordinates (measures x force)
   (loop for measure in measures
-	do (new-draw-measure pane measure x force)
-	do (incf x (size-at-force (elasticity-function measure) force))
-	do (score-pane:draw-bar-line pane x
-				     (- (score-pane:staff-step 8))
-				     (staff-yoffset (car (last staves))))))
+	do (new-compute-measure-coordinates measure x force)
+	do (incf x (size-at-force (elasticity-function measure) force))))
 
 (defun compute-system-coordinates (measures x y widths method)
   (let ((compress (compute-compress-factor measures method))
@@ -589,8 +584,6 @@
 					(+ (final-absolute-element-xoffset (car (last elements))) left) ss2 offset2))))
 	  (loop for element in elements do
 		(draw-element pane element nil))))))
-
-(defgeneric new-draw-bar (pane bar))
 
 (defun draw-the-cursor (pane cursor-element last-note)
   (let* ((cursor (cursor *application-frame*))


Index: gsharp/gui.lisp
diff -u gsharp/gui.lisp:1.47 gsharp/gui.lisp:1.48
--- gsharp/gui.lisp:1.47	Thu Dec  1 02:54:10 2005
+++ gsharp/gui.lisp	Mon Dec  5 04:27:26 2005
@@ -803,7 +803,8 @@
 	do (forward-element (cursor *application-frame*))))
 
 (define-gsharp-command com-backward-element ((count 'integer :prompt "Number of Elements"))
-  (backward-element (cursor *application-frame*)))
+  (loop repeat count
+	do (backward-element (cursor *application-frame*))))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;




More information about the Gsharp-cvs mailing list