Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix draw-order for border.
  • Loading branch information
sammykim committed Aug 23, 2013
1 parent 0c50d43 commit 9f072a0
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/components/gfx/render_context.rs
Expand Up @@ -54,6 +54,13 @@ impl<'self> RenderContext<'self> {
let end = Point2D(rect.origin.x + rect.size.width, y);
self.canvas.draw_target.stroke_line(start, end, &ColorPattern(color.top), &stroke_opts, &draw_opts);

// draw right border
stroke_opts.line_width = border.right;
let x = rect.origin.x + rect.size.width - border.right * 0.5;
let start = Point2D(x, rect.origin.y);
let end = Point2D(x, rect.origin.y + rect.size.height);
self.canvas.draw_target.stroke_line(start, end, &ColorPattern(color.right), &stroke_opts, &draw_opts);

// draw bottom border
stroke_opts.line_width = border.bottom;
let y = rect.origin.y + rect.size.height - border.bottom * 0.5;
Expand All @@ -67,13 +74,6 @@ impl<'self> RenderContext<'self> {
let start = Point2D(x, rect.origin.y);
let end = Point2D(x, rect.origin.y + rect.size.height);
self.canvas.draw_target.stroke_line(start, end, &ColorPattern(color.left), &stroke_opts, &draw_opts);

// draw right border
stroke_opts.line_width = border.right;
let x = rect.origin.x + rect.size.width - border.right * 0.5;
let start = Point2D(x, rect.origin.y);
let end = Point2D(x, rect.origin.y + rect.size.height);
self.canvas.draw_target.stroke_line(start, end, &ColorPattern(color.right), &stroke_opts, &draw_opts);
}

pub fn draw_image(&self, bounds: Rect<Au>, image: Arc<~Image>) {
Expand Down

5 comments on commit 9f072a0

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from metajack
at sammykim@9f072a0

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging sammykim/servo/border-order = 9f072a0 into auto

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sammykim/servo/border-order = 9f072a0 merged ok, testing candidate = a074267

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = a074267

Please sign in to comment.