changeset 103:9b81174f0511

Fixed alignment of borders.
author Mikhail Kryshen <mikhail@kryshen.net>
date Thu, 19 May 2011 17:01:46 +0400
parents fd8fb8a3ff5a
children 491152048c89 24e98602b37e
files src/net/kryshen/indyvon/layers.clj
diffstat 1 files changed, 11 insertions(+), 5 deletions(-) [+]
line diff
     1.1 --- a/src/net/kryshen/indyvon/layers.clj	Wed May 18 21:28:24 2011 +0400
     1.2 +++ b/src/net/kryshen/indyvon/layers.clj	Thu May 19 17:01:46 2011 +0400
     1.3 @@ -81,11 +81,17 @@
     1.4    ([content width gap]
     1.5       (let [layer (padding content (+ width gap))]
     1.6         (decorate-layer layer [_]
     1.7 -         (with-color :border-color
     1.8 -           (doseq [i (range 0 width)]
     1.9 -             (.drawRect *graphics* i i
    1.10 -                        (- *width* 1 i i)
    1.11 -                        (- *height* 1 i i))))
    1.12 +         (let [bw (int width)
    1.13 +               w (int *width*)
    1.14 +               h (int *height*)
    1.15 +               iw (- w bw)
    1.16 +               ih (- h bw)]
    1.17 +           (with-color :border-color
    1.18 +             (doto *graphics*
    1.19 +               (.fillRect 0 0 iw bw)
    1.20 +               (.fillRect iw 0 bw ih)
    1.21 +               (.fillRect bw ih iw bw)
    1.22 +               (.fillRect 0 bw bw ih))))
    1.23           (render! layer)))))
    1.24  
    1.25  ;; TODO: opacity and blur.