[librsvg] marker.rs: Add a type definition for a MarkerRenderFn
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg] marker.rs: Add a type definition for a MarkerRenderFn
- Date: Thu, 2 Mar 2017 22:17:25 +0000 (UTC)
commit 717a9d141d8abee9847c2e381e36b21f297a4058
Author: Federico Mena Quintero <federico gnome org>
Date: Thu Mar 2 13:02:56 2017 -0600
marker.rs: Add a type definition for a MarkerRenderFn
This will take a marker type (start/middle/end) and all the parameters
for rendering a marker.
rust/src/marker.rs | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/rust/src/marker.rs b/rust/src/marker.rs
index a9d8208..6792195 100644
--- a/rust/src/marker.rs
+++ b/rust/src/marker.rs
@@ -573,6 +573,19 @@ fn bisect_angles (incoming: f64, outgoing: f64) -> f64 {
}
}
+// From SVG's marker-start, marker-mid, marker-end properties
+enum MarkerType {
+ Start,
+ Middle,
+ End
+}
+
+type RenderMarkerFn = FnOnce (MarkerType,
+ f64, // xpos
+ f64, // ypos
+ f64, // computed_angle
+ f64); // line_width
+
fn emit_marker_by_name (draw_ctx: *const RsvgDrawingCtx,
marker_name: *const libc::c_char,
xpos: f64,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]