From da84fe8790466157cac18eed1895cffa20d316d4 Mon Sep 17 00:00:00 2001 From: Jim Evins Date: Sun, 16 Mar 2008 03:37:48 +0000 Subject: [PATCH] 2008-03-15 Jim Evins * data/templates/Makefile.am: * data/templates/brother-other-templates.xml: Added brother templates. * src/cairo-markup-path.c: (gl_cairo_markup_margin_rect_path), (gl_cairo_markup_margin_cd_path): * src/view.c: (draw_markup_layer): Fixed markup drawing errors when label is rotated. git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/branches/glabels-2_2@761 f5e0f49d-192f-0410-a22d-a8d8700d0965 --- glabels2/ChangeLog | 10 +++++ glabels2/data/templates/Makefile.am | 1 + .../templates/brother-other-templates.xml | 44 +++++++++++++++++++ glabels2/src/cairo-markup-path.c | 4 +- glabels2/src/view.c | 8 ++++ 5 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 glabels2/data/templates/brother-other-templates.xml diff --git a/glabels2/ChangeLog b/glabels2/ChangeLog index bac40cdf..e0e34033 100644 --- a/glabels2/ChangeLog +++ b/glabels2/ChangeLog @@ -1,3 +1,13 @@ +2008-03-15 Jim Evins + + * data/templates/Makefile.am: + * data/templates/brother-other-templates.xml: + Added brother templates. + * src/cairo-markup-path.c: (gl_cairo_markup_margin_rect_path), + (gl_cairo_markup_margin_cd_path): + * src/view.c: (draw_markup_layer): + Fixed markup drawing errors when label is rotated. + 2008-03-03 Jim Evins * configure.in: diff --git a/glabels2/data/templates/Makefile.am b/glabels2/data/templates/Makefile.am index 63394540..71b1f50b 100644 --- a/glabels2/data/templates/Makefile.am +++ b/glabels2/data/templates/Makefile.am @@ -9,6 +9,7 @@ templates_DATA = \ avery-iso-templates.xml \ avery-other-templates.xml \ zweckform-iso-templates.xml \ + brother-other-templates.xml \ misc-us-templates.xml \ misc-iso-templates.xml \ misc-other-templates.xml diff --git a/glabels2/data/templates/brother-other-templates.xml b/glabels2/data/templates/brother-other-templates.xml new file mode 100644 index 00000000..2158f980 --- /dev/null +++ b/glabels2/data/templates/brother-other-templates.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + diff --git a/glabels2/src/cairo-markup-path.c b/glabels2/src/cairo-markup-path.c index cb7ead7c..04a2a68f 100644 --- a/glabels2/src/cairo-markup-path.c +++ b/glabels2/src/cairo-markup-path.c @@ -153,7 +153,7 @@ gl_cairo_markup_margin_rect_path (cairo_t *cr, m = markup->margin.size; - gl_label_get_size (label, &w, &h); + lgl_template_frame_get_size (frame, &w, &h); w = w - 2*m; h = h - 2*m; r = MAX (frame->rect.r - m, 0.0); @@ -217,7 +217,7 @@ gl_cairo_markup_margin_cd_path (cairo_t *cr, frame = (lglTemplateFrame *)label->template->frames->data; - gl_label_get_size (label, &w, &h); + lgl_template_frame_get_size (frame, &w, &h); xc = w/2.0; yc = h/2.0; diff --git a/glabels2/src/view.c b/glabels2/src/view.c index c35db8d3..a9e7ceeb 100644 --- a/glabels2/src/view.c +++ b/glabels2/src/view.c @@ -905,6 +905,7 @@ draw_markup_layer (glView *view, const lglTemplateFrame *frame; GList *p; lglTemplateMarkup *markup; + gdouble width, height; g_return_if_fail (view && GL_IS_VIEW (view)); g_return_if_fail (view->label && GL_IS_LABEL (view->label)); @@ -917,6 +918,13 @@ draw_markup_layer (glView *view, cairo_save (cr); + if (label->rotate_flag) + { + lgl_template_frame_get_size (frame, &width, &height); + cairo_rotate (cr, -M_PI/2.0); + cairo_translate (cr, -width, 0.0); + } + cairo_set_line_width (cr, MARKUP_LINE_WIDTH_PIXELS/(view->home_scale * view->zoom)); cairo_set_source_rgb (cr, MARKUP_RGB_ARGS); -- 2.39.5