Re: [gnomemm] Gnome::Canvas::Line::property_line_style()



----- Original Message ----- 
From: "Samuel Abels" <spam debain org>
To: "Ole Laursen" <olau hardworking dk>
Cc: <gnomemm-list gnome org>
Sent: Saturday, September 25, 2004 8:31 PM
Subject: Re: [gnomemm] Gnome::Canvas::Line::property_line_style()


> On Sat, 2004-09-25 at 19:52, Ole Laursen wrote:
> > "..." <_janus_ katamail com> writes:
> >
> > > Gnome::Canvas::Line segm = new Gnome::Canvas::Line(*(canvas->root()),
points);
> > > segm->property_width() = 2;
> > > segm->property_color() = "black"
> > > segm->property_line_style() = Gdk::LINE_DOUBLE_DASH;
> > >
> > > where "points" is an appropriate Gnome::Canvas::Points.
> > >
> > > The problem is that the line is filled black but without any
> > > dashing. I tried also Gdk::LINE_ON_OFF_DASH, same problem. It's like
> > > that this instrucion does nothing.
> >
> > I don't think the anti-aliased canvas supports dashed lines, only the
> > GDK-based one. Tough luck.
>
> As an alternative, you could draw the canvas line using ArtVpathDash.
>
> I copied & pasted this together, so I wouldn't bet that it's 100%
> correct, but it gives you the idea:
>
> -------------------------
> Gnome::Canvas::Rect border;
> ArtVpathDash        dash;
> dash.offset  = 0;
> dash.n_dash  = 3;
> dash.dash    = art_new(double, 3);
> dash.dash[0] = 1;
> dash.dash[1] = 1;
> dash.dash[2] = 1;
> border.property_dash() = &dash;
> -------------------------
>
> AFAIK this should work with the AA'd canvas.
>
> -Samuel
> -- 

Thx everybody for your answers. Due to the fact that i was in an hurry i
tried to solve the problem while waiting for some answer: initially i tried
the same solution proposed by Samuel but it wasn't the best for my
application. I'm creating a CASE instrument for class diagrams in UML , it
requires a certain kind of lines and with the trick of the
Gnome::Canvas::Rect the result is fast but graphically poor, specially on
diagonal lines transformed with affine transformations. At the end i created
a function that can create dashed programmable lines between 2 points. If
anyone is interested i'll post it after a shor testing period.
Marcello




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