~vpzom/savg

e16d06fca786f07763e69495b04f81f70515fabc — Colin Reeder 4 years ago 9474a49 master
Resolve lint warnings
3 files changed, 18 insertions(+), 18 deletions(-)

M src/draw.rs
M src/main.rs
M src/types.rs
M src/draw.rs => src/draw.rs +14 -14
@@ 30,15 30,15 @@ pub fn draw_elem(
                match fill {
                    Paint::Color(ref color) => match color {
                        color::Color::RGB(rgb) => gr.set_source_rgb(
                            rgb.r as f64 / 255.0,
                            rgb.g as f64 / 255.0,
                            rgb.b as f64 / 255.0,
                            f64::from(rgb.r) / 255.0,
                            f64::from(rgb.g) / 255.0,
                            f64::from(rgb.b) / 255.0,
                        ),
                        color::Color::RGBA(rgba) => gr.set_source_rgba(
                            rgba.r as f64 / 255.0,
                            rgba.g as f64 / 255.0,
                            rgba.b as f64 / 255.0,
                            rgba.a as f64,
                            f64::from(rgba.r) / 255.0,
                            f64::from(rgba.g) / 255.0,
                            f64::from(rgba.b) / 255.0,
                            f64::from(rgba.a),
                        ),
                    },
                }


@@ 76,15 76,15 @@ pub fn draw_elem(
                match fill {
                    Paint::Color(ref color) => match color {
                        color::Color::RGB(rgb) => gr.set_source_rgb(
                            rgb.r as f64 / 255.0,
                            rgb.g as f64 / 255.0,
                            rgb.b as f64 / 255.0,
                            f64::from(rgb.r) / 255.0,
                            f64::from(rgb.g) / 255.0,
                            f64::from(rgb.b) / 255.0,
                        ),
                        color::Color::RGBA(rgba) => gr.set_source_rgba(
                            rgba.r as f64 / 255.0,
                            rgba.g as f64 / 255.0,
                            rgba.b as f64 / 255.0,
                            rgba.a as f64,
                            f64::from(rgba.r) / 255.0,
                            f64::from(rgba.g) / 255.0,
                            f64::from(rgba.b) / 255.0,
                            f64::from(rgba.a),
                        ),
                    },
                }

M src/main.rs => src/main.rs +2 -2
@@ 171,7 171,7 @@ fn main() {
                    if let Some(selection) = selection {
                        let bbox = selection.as_ref().get_aabb();
                        ctx.set_source_rgb(0.0, 0.0, 0.0);
                        ctx.set_dash(&mut [5.0], 0.0);
                        ctx.set_dash(&[5.0], 0.0);
                        ctx.rectangle(
                            bbox.position.x,
                            bbox.position.y,


@@ 180,7 180,7 @@ fn main() {
                        );
                        ctx.stroke();

                        ctx.set_dash(&mut [], 0.0);
                        ctx.set_dash(&[], 0.0);

                        let tool = instance.tool.read().unwrap();
                        let tool: &ToolMode = &tool;

M src/types.rs => src/types.rs +2 -2
@@ 161,9 161,9 @@ pub struct AABB {

impl AABB {
    pub fn contains(&self, point: &Point2) -> bool {
        return point.x > self.position.x
        point.x > self.position.x
            && point.y > self.position.y
            && point.x < self.position.x + self.size.width
            && point.y < self.position.y + self.size.height;
            && point.y < self.position.y + self.size.height
    }
}