Re: Adding property to "line"



Le Fri, Aug 08, 2003, à 02:04:42PM +0200, Sven Vermeulen a écrit:
On Fri, Aug 08, 2003 at 11:19:28AM +0200, Cyrille Chepelov wrote:
Huh, is it certain that a checkbox is the best thing to do? Shouldn't we
have an enum an nice graphic comboboxes like for the other line properties?
(even if we start by implementing only single and double lines, you can
already argue: how much spacing between the two lines? For instance, if the
basic line width is "lw", it may be useful to have:
    line(lw), space(lw), line(lw) 
but also
    line(lw), space(lw/2), line(lw)
and
    line(lw), space(lw*2), line(lw)
or 
    foreground(lw), background(lw), foreground(lw)
and
    foreground(lw), background(lw*2), foreground(lw)
                            this would be a must with foreground=orange,
                            background=yellow, to sketch a quick map to
                            a destination which includes motorways

At least, SVG is mute on this topic.

It's ofcourse better to have the implementation more flexible, but I'm
actually just searching for a double-line and hope to have something working
in a decent timeschedule. 

Hence my suggestion: make it a two-value ENUM (single or
double-with-whatever-double-definition-you-need). It'll be easier to extend
later in an upwards-compatible way.

I sure don't want to scare you away though... do what you feel up to, the
first patch is always free ;-)

It is on the "Standard - Line" that I want to achieve the double-line
feature. But even when I clear the line_draw() function from dia, the
"Standard - Line" still shows.

When I double-click on that line, I get the properties for it (and it sais
"Properties: Standard - Line") so I'm pretty sure I'm working with the
correct object :)

Hmmm. Are we talking about the right function? 
Look at object/standard/line.c; the structure line_ops says that the 
DrawFunc is line_draw. 

Try this patch:

--- objects/standard/line.c     31 Jul 2003 11:22:07 -0000      1.43
+++ objects/standard/line.c     8 Aug 2003 16:21:04 -0000
@@ -438,6 +438,9 @@
   renderer_ops->set_dashlength(renderer, line->dashlength);
   renderer_ops->set_linecaps(renderer, LINECAPS_BUTT);
  
+  renderer_ops->set_linestyle(renderer, LINESTYLE_DASH_DOT_DOT);
+  printf("kisses from line_draw()\n");
+
   if (line->object_edge_start || line->object_edge_end ||
       line->absolute_start_gap || line->absolute_end_gap ||
       line->fractional_start_gap || line->fractional_end_gap) {


works for me.

        -- Cyrille

-- 

Attachment: pgp8xh984zep7.pgp
Description: PGP signature



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