Re: Bugs in Dia's MetaPost Plug-In

2006-09-17 Thread Michael Duelli
Hi all,

> So the problem is that the bubbles appear at all?  I guess maybe if
> the line width isn't correctly reset between drawing the arrow and
> drawing the rectangle corners using that, we could see this effect.
> The order does come into play in that it determines what should be
> drawn on top of what, which is normally handled in lib/diagramdata.c
> in layer_render, but the plugin can do it itself if it wants to.  If
> anything, it's the same or a related bug as #1, involving correct
> setting of line width -- or maybe some rendering functions don't do
> the linecap correctly.

Now I understand the problem and, of course, you are right. By bringing
the first rectangle into background it is drawn before the thick arrow
and therefore line width was not yet touched. So of course, there is
only the line width bug.

The problem lies more or less in the end_draw_op method:
It is called in plug-ins/metapost/render_metapost.c::fill_rect and this
method is called in objects/standard/box.c::box_draw.
But this happens before there the method set_linewidth is called, so we
still use the old line width as it was set, e.g. by a thick lined arrow.

Several solutions are possible:
1.) Move all lines calling set_* methods in objects/standard/box.c such
that this code is executed before the fill methods.
2.) eleminate end_draw_op which mean a lot of duplicated code (not
good!) 
3.) create a new global variable which remembers whether or not end
_draw_op fills an object or draws a line and such decides which line
width to use (this was the first idea for my patch, before I got behind
it)

Actually I prefer the first solution, but I don't know if there could
be any interferences with other plugins or so. I tried this solution
and can't see any problems, but maybe you do.

> It might behoove the metapost plugin to
> define its own rendering for rounded rectangle, I would think it can
> do it better than the default (which uses quarter-arcs).
This should be possible. I will think about it.

> > I already wrote a patch for this which I will send to this list. It
> > simply remembers at the end of each function whether it is going to
> > draw a line or to fill an area in the function
> > render_metapost.c::end_draw_op.
> 
> Shouldn't you be setting the corner style, too, to avoid rounded
> corners on non-filled arrows (see attached file)?  
Forget about the patch I told you about. I got an idea for this, give me
some time.

Ciao,
Michi

P.S.: Would you mind adding *.lo and *.la to the .cvsignore file of the
visio plugin directory (plug-ins/vdx/) ?! Maybe the same with stamp-it
in po directory but I don't really know.
___
Dia-list mailing list
Dia-list@gnome.org
http://mail.gnome.org/mailman/listinfo/dia-list
FAQ at http://www.gnome.org/projects/dia/faq.html
Main page at http://www.gnome.org/projects/dia



win32 dia with python

2006-09-17 Thread Mike Dewhirst
Has anybody got Dia with Python support working in Windows?

I've really tried hard to compile it in MinGW but unsuccessfully. Robert 
Staudinger was right. I decided I don't have the knowledge or 
experience. I even had trouble compiling infrastructure stuff like 
pkg-config and other minor bits and pieces.

I'm looking for binaries or a MinGW howto aimed at Dia compilation with 
Python. I don't have MSVC.

Maybe there is a cross compilation mechanism in Linux which will produce 
Dia for Windows with Python support?

Thanks for any help.
___
Dia-list mailing list
Dia-list@gnome.org
http://mail.gnome.org/mailman/listinfo/dia-list
FAQ at http://www.gnome.org/projects/dia/faq.html
Main page at http://www.gnome.org/projects/dia