geckolib: Cap background-xxx properties at 1

This commit is contained in:
Emilio Cobos Álvarez 2016-06-16 11:27:37 +02:00
parent fa6dd1d61b
commit 827c71d8ca
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

View file

@ -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;
}