@@ -50,9 +50,26 @@ pub fn draw_rectangle(x: f32, y: f32, w: f32, h: f32, color: Color) {
50
50
51
51
/// Draws a rectangle outline with its top-left corner at `[x, y]` with size `[w, h]` (width going to
52
52
/// the right, height going down), with a given line `thickness` and `color`.
53
+ ///
54
+ /// # Deprecation
55
+ /// Due to a bug, this function does not actually draw lines that are `thickness` thick, but only `thickness / 2.`.
56
+ /// To preserve backwards compability, this function was not changed, and
57
+ /// a new function `draw_rectangle_lines_fixed` was added, which does not contain the bug.
58
+ ///
59
+ /// See https://github.com/not-fl3/macroquad/issues/704 for more details.
60
+ #[ deprecated(
61
+ since = "0.4.12" ,
62
+ note = "incorrect thickness handling, see issue #704. use `draw_rectangle_lines_fixed`"
63
+ ) ]
53
64
pub fn draw_rectangle_lines ( x : f32 , y : f32 , w : f32 , h : f32 , thickness : f32 , color : Color ) {
65
+ draw_rectangle_lines_fixed ( x, y, w, h, thickness / 2. , color) ;
66
+ }
67
+
68
+ /// Draws a rectangle outline with its top-left corner at `[x, y]` with size `[w, h]` (width going to
69
+ /// the right, height going down), with a given line `thickness` and `color`.
70
+ pub fn draw_rectangle_lines_fixed ( x : f32 , y : f32 , w : f32 , h : f32 , thickness : f32 , color : Color ) {
54
71
let context = get_context ( ) ;
55
- let t = thickness / 2. ;
72
+ let t = thickness;
56
73
57
74
#[ rustfmt:: skip]
58
75
let vertices = [
0 commit comments