Skip to content
Permalink
Browse files

Use new_all_same with same value instead of new

  • Loading branch information...
sammykim committed Aug 16, 2013
1 parent 0e863b3 commit 3616c033d63cef6695e765331a1536f744320275
Showing with 6 additions and 20 deletions.
  1. +6 −20 src/components/main/layout/box.rs
@@ -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))

0 comments on commit 3616c03

Please sign in to comment.
You can’t perform that action at this time.