[lasem] Aded a baseline argument to lsm_dom_view_get_size().



commit a4c09de006033c0d933eb4be07d195456ff92405
Author: Jean Brefort <jean brefort normalesup org>
Date:   Mon Jul 4 16:41:54 2011 +0200

    Aded a baseline argument to lsm_dom_view_get_size().

 src/lasemrender.c   |    4 ++--
 src/lsmdomview.h    |    4 ++--
 src/lsmmathmlview.c |    2 +-
 src/lsmsvgview.c    |    2 +-
 tests/lsmtest.c     |    2 +-
 tests/suite.c       |    2 +-
 6 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/src/lasemrender.c b/src/lasemrender.c
index ab0119c..ae55d78 100644
--- a/src/lasemrender.c
+++ b/src/lasemrender.c
@@ -187,8 +187,8 @@ int main(int argc, char **argv)
 		width_pt = 2.0;
 		height_pt = 2.0;
 
-		lsm_dom_view_get_size (view, &width_pt, &height_pt);
-		lsm_dom_view_get_size_pixels (view, &width, &height);
+		lsm_dom_view_get_size (view, &width_pt, &height_pt, NULL);
+		lsm_dom_view_get_size_pixels (view, &width, &height, NULL);
 
 		switch (format) {
 			case FORMAT_PDF:
diff --git a/src/lsmdomview.h b/src/lsmdomview.h
index 395f791..da7fba6 100644
--- a/src/lsmdomview.h
+++ b/src/lsmdomview.h
@@ -62,8 +62,8 @@ struct _LsmDomViewClass {
 
 GType lsm_dom_view_get_type (void);
 
-void 			lsm_dom_view_render 		(LsmDomView *view, cairo_t *cairo, double x, double y, double *baseline);
-void			lsm_dom_view_get_size		(LsmDomView *view, double *width, double *height);
+void 			lsm_dom_view_render 		(LsmDomView *view, cairo_t *cairo, double x, double y);
+void			lsm_dom_view_get_size		(LsmDomView *view, double *width, double *height, double *baseline);
 void 			lsm_dom_view_get_size_pixels 	(LsmDomView *view, unsigned int *width, unsigned int *height, unsigned int *baseline);
 
 void 			lsm_dom_view_set_document 	(LsmDomView *view, LsmDomDocument *document);
diff --git a/src/lsmmathmlview.c b/src/lsmmathmlview.c
index 27c3a9c..44c1088 100644
--- a/src/lsmmathmlview.c
+++ b/src/lsmmathmlview.c
@@ -979,7 +979,7 @@ lsm_mathml_view_render (LsmDomView *dom_view)
 
 	resolution_ppi = lsm_dom_document_get_resolution (view->dom_view.document);
 
-	bbox = _view_measure (view, NULL, NULL);
+	bbox = _view_measure (view, NULL, NULL, NULL);
 
 	lsm_mathml_math_element_layout (math_element, view, bbox);
 
diff --git a/src/lsmsvgview.c b/src/lsmsvgview.c
index 364e6a0..a2781d2 100644
--- a/src/lsmsvgview.c
+++ b/src/lsmsvgview.c
@@ -2057,7 +2057,7 @@ lsm_svg_view_measure (LsmDomView *view, double *width, double *height, double *b
 
 	lsm_svg_svg_element_measure (svg_element, width, height);
 	if (baseline)
-		baseline = -1.; /* or anything else as nan or inf */
+		*baseline = *height;
 }
 
 static void
diff --git a/tests/lsmtest.c b/tests/lsmtest.c
index 2599143..48ab51d 100644
--- a/tests/lsmtest.c
+++ b/tests/lsmtest.c
@@ -135,7 +135,7 @@ lasem_test_render (char const *filename)
 
 		lsm_dom_document_set_resolution (document, option_ppi);
 		lsm_dom_document_set_viewport_px (document, &viewport);
-		lsm_dom_view_get_size_pixels (LSM_DOM_VIEW (view), &width, &height);
+		lsm_dom_view_get_size_pixels (LSM_DOM_VIEW (view), &width, &height, NULL);
 
 		surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width + 2, height + 2);
 		cairo = cairo_create (surface);
diff --git a/tests/suite.c b/tests/suite.c
index 469ff43..4305c84 100644
--- a/tests/suite.c
+++ b/tests/suite.c
@@ -67,7 +67,7 @@ render_test (gconstpointer user_data)
 
 	lsm_dom_document_set_resolution (document, 96);
 	lsm_dom_document_set_viewport_px (document, &viewport);
-	lsm_dom_view_get_size_pixels (LSM_DOM_VIEW (view), &width, &height);
+	lsm_dom_view_get_size_pixels (LSM_DOM_VIEW (view), &width, &height, NULL);
 
 	surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width, height);
 	cairo = cairo_create (surface);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]