1
From: Mehdi Dogguy <mehdi@debian.org>
2
Date: Sun, 25 Apr 2010 14:54:50 +0200
3
Subject: [PATCH] dgraph: handle dotted ellipse
5
Patch stolen from upstream dev version
7
dgraph/dGraphViewItem.ml | 27 ++++++++++++---------------
8
1 files changed, 12 insertions(+), 15 deletions(-)
10
diff --git a/dgraph/dGraphViewItem.ml b/dgraph/dGraphViewItem.ml
11
index 35cb4fc..30c67a2 100644
12
--- a/dgraph/dGraphViewItem.ml
13
+++ b/dgraph/dGraphViewItem.ml
14
@@ -207,20 +207,23 @@ class shape ~fill shape init_props = object (self)
18
-let ellipse ~fill draw_st group pos w h =
19
- let((x1,y1), (x2,y2)) = XDot.bounding_box pos w h in
20
- let props = [ pen_color draw_st; fill_color draw_st ] in
21
- let ellip = GnoCanvas.ellipse group ~x1 ~y1 ~x2 ~y2 ~props in
22
- new shape ~fill (SEllipse ellip) props
24
-let polygon ~fill draw_st group pts =
25
+let get_props draw_st =
26
let base_props = [ pen_color draw_st; fill_color draw_st ] in
27
let fold_sty_attr props = function
28
| Dashed -> `DASH (0., [|10.|]) :: props
29
| Dotted -> `DASH (0., [|2.; 10.|]) :: props
32
- let props = List.fold_left fold_sty_attr base_props draw_st.style in
33
+ List.fold_left fold_sty_attr base_props draw_st.style
35
+let ellipse ~fill draw_st group pos w h =
36
+ let((x1,y1), (x2,y2)) = XDot.bounding_box pos w h in
37
+ let props = get_props draw_st in
38
+ let ellip = GnoCanvas.ellipse group ~x1 ~y1 ~x2 ~y2 ~props in
39
+ new shape ~fill (SEllipse ellip) props
41
+let polygon ~fill draw_st group pts =
42
+ let props = get_props draw_st in
43
let points = flatten_points pts in
44
let poly = GnoCanvas.polygon group ~points ~props in
45
new shape ~fill (SPolygon poly) props
46
@@ -248,13 +251,7 @@ let bspline ~fill draw_st group pts =
48
pathdef (Array.fold_right (fun p acc -> XDot.conv_coord p :: acc) pts [])
50
- let base_props = [ pen_color draw_st; fill_color draw_st ] in
51
- let fold_sty_attr props = function
52
- | Dashed -> `DASH (0., [|10.|]) :: props
53
- | Dotted -> `DASH (0., [|2.; 10.|]) :: props
56
- let props = List.fold_left fold_sty_attr base_props draw_st.style in
57
+ let props = get_props draw_st in
58
let bpath = GnoCanvas.bpath group ~bpath:path ~props in
59
new shape ~fill (SBSpline bpath) props