-(define (resetcolor)
- (string-append "setrgbcolor\n"))
-
-(define (round-filled-box x y width height blotdiam)
- (string-append
- (ly:numbers->string
- (list x y width height blotdiam)) " draw_round_box"))
+(define (resetcolor) "setrgbcolor\n")
+
+;; reset rotation
+(define (resetrotation ang x y)
+ (format "~a translate ~a rotate ~a translate\n"
+ (numbers->string4 (list x y))
+ (number->string (* -1 ang))
+ (numbers->string4 (list (* -1 x) (* -1 y)))))
+
+(define (round-filled-box left right bottom top blotdiam)
+ (let* ((halfblot (/ blotdiam 2))
+ (x (- halfblot left))
+ (width (- right (+ halfblot x)))
+ (y (- halfblot bottom))
+ (height (- top (+ halfblot y))))
+ (format #f "~a draw_round_box"
+ (numbers->string4
+ (list width height x y blotdiam)))))