Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Use new_all_same with same value instead of new
  • Loading branch information
sammykim committed Aug 20, 2013
1 parent 0e863b3 commit 3616c03
Showing 1 changed file with 6 additions and 20 deletions.
26 changes: 6 additions & 20 deletions src/components/main/layout/box.rs
Expand Up @@ -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))
Expand All @@ -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))
Expand All @@ -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 {
Expand All @@ -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))
Expand Down

0 comments on commit 3616c03

Please sign in to comment.