Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement asymmetric border colors #689

Merged
merged 4 commits into from Aug 20, 2013
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Use new_all_same with same value instead of new

  • Loading branch information
sammykim committed Aug 20, 2013
commit 3616c033d63cef6695e765331a1536f744320275
@@ -628,21 +628,16 @@ impl RenderBox {
// should have a real `SERVO_DEBUG` system.
debug!("%?", {
// Compute the text box bounds and draw a border surrounding them.
let debug_border = SideOffsets2D::new(Au::from_px(1),
Au::from_px(1),
Au::from_px(1),
Au::from_px(1));
let debug_border = SideOffsets2D::new_all_same(Au::from_px(1));

do list.with_mut_ref |list| {
let border_display_item = ~BorderDisplayItem {
base: BaseDisplayItem {
bounds: absolute_box_bounds,
extra: ExtraDisplayListData::new(*self),
},
border: debug_border,
color: SideOffsets2D::new(rgb(0, 0, 200).to_gfx_color(),
rgb(0, 0, 200).to_gfx_color(),
rgb(0, 0, 200).to_gfx_color(),
rgb(0, 0, 200).to_gfx_color())
color: SideOffsets2D::new_all_same(rgb(0, 0, 200).to_gfx_color())

};
list.append_item(BorderDisplayItemClass(border_display_item))
@@ -663,10 +658,7 @@ impl RenderBox {
extra: ExtraDisplayListData::new(*self),
},
border: debug_border,
color: SideOffsets2D::new(rgb(0, 200, 0).to_gfx_color(),
rgb(0, 200, 0).to_gfx_color(),
rgb(0, 200, 0).to_gfx_color(),
rgb(0, 200, 0).to_gfx_color())
color: SideOffsets2D::new_all_same(rgb(0, 200, 0).to_gfx_color())

};
list.append_item(BorderDisplayItemClass(border_display_item))
@@ -683,10 +675,7 @@ impl RenderBox {
// FIXME(pcwalton): This is a bit of an abuse of the logging infrastructure. We
// should have a real `SERVO_DEBUG` system.
debug!("%?", {
let debug_border = SideOffsets2D::new(Au::from_px(1),
Au::from_px(1),
Au::from_px(1),
Au::from_px(1));
let debug_border = SideOffsets2D::new_all_same(Au::from_px(1));

do list.with_mut_ref |list| {
let border_display_item = ~BorderDisplayItem {
@@ -695,10 +684,7 @@ impl RenderBox {
extra: ExtraDisplayListData::new(*self),
},
border: debug_border,
color: SideOffsets2D::new(rgb(0, 0, 200).to_gfx_color(),
rgb(0, 0, 200).to_gfx_color(),
rgb(0, 0, 200).to_gfx_color(),
rgb(0, 0, 200).to_gfx_color())
color: SideOffsets2D::new_all_same(rgb(0, 0, 200).to_gfx_color())

};
list.append_item(BorderDisplayItemClass(border_display_item))
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.