                                   (if (= cur-vals saved-vals) :clear :save)
                                   (when (not= cur-vals (:starting-vars info))
                                     :save)))]
-              (write-display-cell controller 0 x (cue-variable-names controller cue (:id info)))
+              (draw-cue-variable-names controller x cue (:id info))
               (write-display-cell controller 1 x (cue-variable-values controller cue (:id info)))
               (set-graphics-color graphics color)
               (.fillRect graphics (+ left (/ button-cell-margin 2.0)) (- Wayang/DISPLAY_HEIGHT 38)

    1 (vec (repeat 2 (first cue-vars)))
    (vec (take 2 (drop var-offset (apply concat (repeat cue-vars)))))))

(defn- fit-cue-variable-name
  "Picks the best version of a cue variable name to fit in the specified
  number of characters, then truncates it if necessary."
  [v len]
  (let [longer (or (:name v) (name (:key v)))
        shorter (or (:short-name v) longer)
        padding (clojure.string/join (repeat len " "))]
    (if (<= (count longer) len)
      (clojure.string/join (take len (str longer padding)))
      (clojure.string/join (take len (str shorter padding))))))

(defn- cue-variable-names
  "Determines the names of adjustable variables to display under an
  active cue."
  [controller cue effect-id]
  (let [cue-vars (cue-vars-for-encoders (:variables cue) (get @(:cue-var-offsets controller) effect-id 0))]
    (if (seq cue-vars)
      (if (= (count (:variables cue)) 1)
        (fit-cue-variable-name (first cue-vars) 17)
        (str (fit-cue-variable-name (first cue-vars) 8) " "
             (fit-cue-variable-name (second cue-vars) 8)))
      "")))

(defn- fit-cue-variable-value
  "Truncates the current value of a cue variable to fit available

    (.drawString graphics label (int (math/round (- (* (+ index 0.5) button-cell-width) (/ width 2))))
                 (- Wayang/DISPLAY_HEIGHT 4))))

(defn- space-for-encoder-button-label
  "Calculate how much room there is to draw a label under an encoder,
  based on how many encoders the label applies to."
  [encoder-count]
  (- (* button-cell-width encoder-count) button-cell-margin))

(def font-for-encoder-button-label
  "The font used when drawing labels under encoders."
  (get-display-font :condensed-light Font/PLAIN 14))

(def encoder-label-underline-height
  "The height at which to draw the line under an encoder label."
  20.0)

(defn draw-encoder-button-label
  "Draw a label under an encoder at the top of the graphical display."
  [controller index encoder-count text color]
  (let [graphics (create-graphics controller)
        space (space-for-encoder-button-label encoder-count)
        metrics (.getFontMetrics graphics font-for-encoder-button-label)
        label (fit-string text metrics space)
        width (.stringWidth metrics label)]
    (set-graphics-color graphics color)
    (.setFont graphics font-for-encoder-button-label)
    (.drawString graphics label
                 (int (math/round (- (* (+ index (/ encoder-count 2)) button-cell-width) (/ width 2)))) 16)
    (.draw graphics (java.awt.geom.Line2D$Double.
                     (+ (* index button-cell-width) (/ button-cell-margin 2.0)) encoder-label-underline-height
                     (- (* (+ index encoder-count) button-cell-width) (/ button-cell-margin 2.0) 1.0)
                     encoder-label-underline-height))))

(defn ^:deprecated make-gauge
  "Create a graphical gauge with an indicator that fills a line.
  The default range is from zero to a hundred, and the default size is
