Skip to content

Commit

Permalink
WIP: debug commit
Browse files Browse the repository at this point in the history
  • Loading branch information
fishrockz committed Apr 8, 2020
1 parent 94ee520 commit 8454c76
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions druid/src/widget/svg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,13 @@ impl<T: Data> Widget<T> for Svg {
}
}
fn paint(&mut self, ctx: &mut PaintCtx, _data: &T, _env: &Env) {
assert!(ctx.size().width > 0.0, "ctx width zero");
assert!(ctx.size().height > 0.0, "ctx height zero");
let offset_matrix = self.fill.affine_to_fill(ctx.size(), self.get_size());

let clip_rect = Rect::ZERO.with_size(ctx.size());
assert!(clip_rect.width() > 0.0, "clip width zero");
assert!(clip_rect.height() > 0.0, "clip height zero");

// The SvgData's to_piet function dose not clip to the svg's size
// CairoRenderContext is very like druids but with some extra goodies like clip
Expand Down

0 comments on commit 8454c76

Please sign in to comment.