Skip to content

draw-box-* draws rectangle one pixel wider and higher than specified in arguments #40

Description

@GoogleCodeExporter
What steps will reproduce the problem?
(sdl:draw-box-* 0 0 10 10 :color sdl:*green*) draws rectangle with dimensions 
11x11, while (sdl:draw-rectangle-* 0 0 10 10 :color sdl:*green*) draws 10x10 
rectangle (screenshot attached).

What is the expected output? What do you see instead?
(sdl:draw-box-* 0 0 10 10 :color sdl:*green*) should draw 10x10 rectangle

What version of the product are you using? On what operating system?
Ubuntu 12.10, SBCL

Please provide any additional information below.
Seems like error is in a way draw-box-edges-* called:
(defun draw-box-* (x y w h &key (clipping nil) (surface *default-surface*) 
(color *default-color*) (stroke-color nil) (alpha nil) (gfx-loaded-p 
*gfx-loaded-p*))
  (if gfx-loaded-p
    ;;
    ;; (+ x w) should be (1- (+ x w). The same is for height.
    ;;
    (draw-box-edges-* x y (+ x w) (+ y h) :surface surface :color color) 
    (with-rectangle (template (rectangle :x x :y y :w w :h h))
      (draw-box template :clipping clipping :surface surface :color color
                :stroke-color stroke-color :alpha alpha))))


Original issue reported on code.google.com by [email protected] on 30 Mar 2013 at 1:08

Attachments:

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions