Created
May 19, 2014 17:49
-
-
Save dharmatech/16000fa777356ee74cbc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub fn draw_push_clip(&self, bounds: &Rect<Au>) { | |
let rect = bounds.to_azure_rect(); | |
let left_top = Point2D(rect.origin.x, rect.origin.y); | |
let right_top = Point2D(rect.origin.x + rect.size.width, rect.origin.y); | |
let left_bottom = Point2D(rect.origin.x, rect.origin.y + rect.size.height); | |
let right_bottom = Point2D(rect.origin.x + rect.size.width, rect.origin.y + rect.size.height); | |
let path = self.draw_target.create_path_builder() | |
.. move_to(left_top) | |
.. line_to(right_top) | |
.. line_to(right_bottom) | |
.. line_to(left_bottom) | |
.. finish(); | |
self.draw_target.push_clip(&path); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment