Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dharmatech/16000fa777356ee74cbc to your computer and use it in GitHub Desktop.
Save dharmatech/16000fa777356ee74cbc to your computer and use it in GitHub Desktop.
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