[librsvg: 2/90] DrawingCtx: don't use the base offsets at all
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 2/90] DrawingCtx: don't use the base offsets at all
- Date: Tue, 26 Mar 2019 19:12:13 +0000 (UTC)
commit 2f119bbbf1d740d62c25e0ce03d21968d4498729
Author: Federico Mena Quintero <federico gnome org>
Date: Fri Mar 8 09:43:14 2019 -0600
DrawingCtx: don't use the base offsets at all
We will always operate with respect to the initial transformation matrix.
rsvg_internals/src/drawing_ctx.rs | 10 ++++++++++
1 file changed, 10 insertions(+)
---
diff --git a/rsvg_internals/src/drawing_ctx.rs b/rsvg_internals/src/drawing_ctx.rs
index 93c52b87..652a9210 100644
--- a/rsvg_internals/src/drawing_ctx.rs
+++ b/rsvg_internals/src/drawing_ctx.rs
@@ -135,6 +135,9 @@ impl DrawingCtx {
cairo::Matrix::identity(),
)
} else {
+ let rect = *viewport;
+ let affine = cairo::Matrix::identity();
+ /*
let mut affine = cr.get_matrix();
let rect = viewport.transform(&affine).outer();
@@ -143,6 +146,7 @@ impl DrawingCtx {
affine.x0 -= rect.x;
affine.y0 -= rect.y;
cr.set_matrix(affine);
+ */
// https://www.w3.org/TR/SVG2/coords.html#InitialCoordinateSystem
//
@@ -360,11 +364,14 @@ impl DrawingCtx {
}
fn get_offset(&self) -> (f64, f64) {
+ /*
if self.is_cairo_context_nested(&self.get_cairo_context()) {
(0.0, 0.0)
} else {
(self.rect.x, self.rect.y)
}
+ */
+ (0.0, 0.0)
}
pub fn with_discrete_layer(
@@ -734,7 +741,10 @@ impl DrawingCtx {
}
pub fn get_snapshot(&self, surface: &cairo::ImageSurface) {
+ /*
let (x, y) = (self.rect.x, self.rect.y);
+ */
+ let (x, y) = (0.0, 0.0);
// TODO: as far as I can tell this should not render elements past the last (topmost) one
// with enable-background: new (because technically we shouldn't have been caching them).
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]