From 827c71d8ca1bd00e189e5a89d5974b53d3179296 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Thu, 16 Jun 2016 11:27:37 +0200 Subject: [PATCH] geckolib: Cap background-xxx properties at 1 --- ports/geckolib/properties.mako.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/geckolib/properties.mako.rs b/ports/geckolib/properties.mako.rs index e1336492881..a49eeb5ab16 100644 --- a/ports/geckolib/properties.mako.rs +++ b/ports/geckolib/properties.mako.rs @@ -757,7 +757,7 @@ fn static_assert() { <% impl_color("background_color", "mBackgroundColor") %> fn copy_background_repeat_from(&mut self, other: &Self) { - self.gecko.mImage.mRepeatCount = other.gecko.mImage.mRepeatCount; + self.gecko.mImage.mRepeatCount = cmp::min(1, other.gecko.mImage.mRepeatCount); self.gecko.mImage.mLayers.mFirstElement.mRepeat = other.gecko.mImage.mLayers.mFirstElement.mRepeat; } @@ -785,7 +785,7 @@ fn static_assert() { } fn copy_background_clip_from(&mut self, other: &Self) { - self.gecko.mImage.mClipCount = other.gecko.mImage.mClipCount; + self.gecko.mImage.mClipCount = cmp::min(1, other.gecko.mImage.mClipCount); self.gecko.mImage.mLayers.mFirstElement.mClip = other.gecko.mImage.mLayers.mFirstElement.mClip; } @@ -804,7 +804,7 @@ fn static_assert() { } fn copy_background_origin_from(&mut self, other: &Self) { - self.gecko.mImage.mOriginCount = other.gecko.mImage.mOriginCount; + self.gecko.mImage.mOriginCount = cmp::min(1, other.gecko.mImage.mOriginCount); self.gecko.mImage.mLayers.mFirstElement.mOrigin = other.gecko.mImage.mLayers.mFirstElement.mOrigin; } @@ -821,7 +821,7 @@ fn static_assert() { } fn copy_background_attachment_from(&mut self, other: &Self) { - self.gecko.mImage.mAttachmentCount = other.gecko.mImage.mAttachmentCount; + self.gecko.mImage.mAttachmentCount = cmp::min(1, other.gecko.mImage.mAttachmentCount); self.gecko.mImage.mLayers.mFirstElement.mAttachment = other.gecko.mImage.mLayers.mFirstElement.mAttachment; }