mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
auto merge of #4829 : servo/servo/revert-4825-usingColorOperators01, r=jdm
Reverts servo/servo#4825 I merged this incorrectly via the big green button and busted the tree pretty badly. @Adenilson has committed to fixing the issue in rust-azure and then relanding this in a fixed state.
This commit is contained in:
commit
e48eb87eb4
2 changed files with 8 additions and 3 deletions
|
@ -730,7 +730,8 @@ impl<'a> PaintContext<'a> {
|
||||||
|
|
||||||
let mut lighter_color;
|
let mut lighter_color;
|
||||||
let mut darker_color = color::black();;
|
let mut darker_color = color::black();;
|
||||||
if color != darker_color {
|
// TODO(Savago): Use equality operators when we sync with rust-azure.
|
||||||
|
if color.r != darker_color.r || color.g != darker_color.g || color.b != darker_color.b {
|
||||||
darker_color = self.scale_color(color, if is_groove { 1.0/3.0 } else { 2.0/3.0 });
|
darker_color = self.scale_color(color, if is_groove { 1.0/3.0 } else { 2.0/3.0 });
|
||||||
lighter_color = color;
|
lighter_color = color;
|
||||||
} else {
|
} else {
|
||||||
|
@ -774,7 +775,8 @@ impl<'a> PaintContext<'a> {
|
||||||
|
|
||||||
// You can't scale black color (i.e. 'scaled = 0 * scale', equals black).
|
// You can't scale black color (i.e. 'scaled = 0 * scale', equals black).
|
||||||
let mut scaled_color = color::black();
|
let mut scaled_color = color::black();
|
||||||
if color != scaled_color {
|
// TODO(Savago): Use equality operators when we sync with rust-azure.
|
||||||
|
if color.r != scaled_color.r || color.g != scaled_color.g || color.b != scaled_color.b {
|
||||||
scaled_color = match direction {
|
scaled_color = match direction {
|
||||||
Direction::Top | Direction::Left => {
|
Direction::Top | Direction::Left => {
|
||||||
self.scale_color(color, if is_inset { 2.0/3.0 } else { 1.0 })
|
self.scale_color(color, if is_inset { 2.0/3.0 } else { 1.0 })
|
||||||
|
|
|
@ -678,7 +678,10 @@ impl LayoutTask {
|
||||||
};
|
};
|
||||||
|
|
||||||
let black = color::black();
|
let black = color::black();
|
||||||
if element_bg_color != black {
|
// TODO: Use equality operators when we sync with rust-azure.
|
||||||
|
if element_bg_color.r != black.r || element_bg_color.g != black.g ||
|
||||||
|
element_bg_color.b != black.b || element_bg_color.a != black.a {
|
||||||
|
|
||||||
color = element_bg_color;
|
color = element_bg_color;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue