Article View: comp.windows.interviews
Article #94line joins, line endings, fill rule etc.
From: jdf
Date: Thu, 23 Jul 1992 14:14
Date: Thu, 23 Jul 1992 14:14
44 lines
1861 bytes
1861 bytes
Would it be possible to add canvas member functions to control the
drawing parameters for the style of line joins, line endings, and
filling rules. Since they are available both on X drawables and on
PostScript printers, I think it should be quite easy to add them to
the current implementation.
I suggest the following functionnalities in canvas.h:
enum FillRule { fill_eo, fill_nzw };
enum CapStyle { cap_not_last, cap_butt, cap_round, cap_projecting };
enum JoinStyle { join_miter, join_round, join_bevel };
class Canvas {
public:
...
virtual void fill_rule(FillRule);
virtual FillRule fill_rule() const;
virtual void cap_style(CapStyle);
virtual CapStyle cap_style() const;
virtual void join_style(JoinStyle);
virtual JoinStyle join_style() const;
virtual void push_gstate();
virtual void pop_gstate();
...
};
Another choice would be to overload stroke and fill like this:
class Canvas {
public:
...
virtual void stroke(const Color*, const Brush*);
virtual void stroke(const Color*, const Brush*, CapStyle, JoinStyle);
....
virtual void fill(const Color*);
virtual void fill(const Color*, FillRule);
};
Any comment ?
___ 0 Jean-Daniel Fekete uucp : jdf@lri.lri.fr
/ \ / LRI - Bat 490 bitnet: jdf@FRLRI61.bitnet
/ _/ / Universite de Paris-Sud voice : +33 (1) 69 41 65 91
/__ \/ F-91405 ORSAY Cedex +33 (1) 69 41 66 29
Technical Details
Message-ID:
<9207231414.AA01034@sun8.lri.fr>Path:
arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!lri.fr!jdfShow Full Headers
Complete Article Headers
Newsgroups: comp.windows.interviews Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!lri.fr!jdf From: jdf@lri.fr Subject: line joins, line endings, fill rule etc. Message-ID: <9207231414.AA01034@sun8.lri.fr> Sender: news@shelby.stanford.edu (USENET News System) Organization: Internet-USENET Gateway at Stanford University Date: Thu, 23 Jul 1992 14:14:44 GMT Lines: 44