~vpzom/savg

cc6ae727e6b856e98f2d965f58038646fcf85f4c — Colin Reeder 5 years ago 1550994
Fix negative scales
1 files changed, 10 insertions(+), 0 deletions(-)

M src/document.rs
M src/document.rs => src/document.rs +10 -0
@@ 99,6 99,16 @@ impl ScalableElement for Rect {
    }
    fn set_size(&mut self, size: Size2) {
        self.size = size;

        // normalize
        if self.size.width < 0.0 {
            self.position.x += self.size.width;
            self.size.width = -self.size.width;
        }
        if self.size.height < 0.0 {
            self.position.y += self.size.height;
            self.size.height = -self.size.height;
        }
    }
}