~ubuntu-branches/ubuntu/natty/ocamlgraph/natty

« back to all changes in this revision

Viewing changes to debian/patches/0003-dgraph-handle-dotted-ellipse.patch

  • Committer: Bazaar Package Importer
  • Author(s): Mehdi Dogguy
  • Date: 2010-05-15 15:10:43 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20100515151043-dc0ukpzcwnle266b
Tags: 1.5-1
* New upstream release
  + Remove 0003-dgraph-handle-dotted-ellipse.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From: Mehdi Dogguy <mehdi@debian.org>
2
 
Date: Sun, 25 Apr 2010 14:54:50 +0200
3
 
Subject: [PATCH] dgraph: handle dotted ellipse
4
 
 
5
 
Patch stolen from upstream dev version
6
 
---
7
 
 dgraph/dGraphViewItem.ml |   27 ++++++++++++---------------
8
 
 1 files changed, 12 insertions(+), 15 deletions(-)
9
 
 
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)
15
 
 
16
 
 end
17
 
 
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
23
 
-
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
30
 
     | _ -> props
31
 
   in
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
34
 
+
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
40
 
+
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 =
47
 
   let path =
48
 
     pathdef (Array.fold_right (fun p acc -> XDot.conv_coord p :: acc) pts [])
49
 
   in
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
54
 
-    | _ -> props
55
 
-  in
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
60