summaryrefslogtreecommitdiff
path: root/src/renderers/sliceRenderer.vala
diff options
context:
space:
mode:
authorAlessandro Ghedini <al3xbio@gmail.com>2012-01-21 19:07:09 +0100
committerAlessandro Ghedini <al3xbio@gmail.com>2012-01-21 19:07:09 +0100
commit60560a030fda3c539ff9dc1563b9926414a193da (patch)
tree77590b395685a8d48d3615e45629a1610d08c071 /src/renderers/sliceRenderer.vala
parentd6b2677825cbb423e2099563c16321c3e23d7899 (diff)
Imported Upstream version 0.4.0upstream/0.4.0
Diffstat (limited to 'src/renderers/sliceRenderer.vala')
-rw-r--r--src/renderers/sliceRenderer.vala23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/renderers/sliceRenderer.vala b/src/renderers/sliceRenderer.vala
index 61c50b1..4803070 100644
--- a/src/renderers/sliceRenderer.vala
+++ b/src/renderers/sliceRenderer.vala
@@ -20,7 +20,7 @@ using GLib.Math;
namespace GnomePie {
/////////////////////////////////////////////////////////////////////////
-/// Renders a Slice of a Pie. According to the current theme.
+/// Renders a Slice of a Pie. According to the current theme.
/////////////////////////////////////////////////////////////////////////
public class SliceRenderer : GLib.Object {
@@ -123,7 +123,9 @@ public class SliceRenderer : GLib.Object {
this.caption = new RenderedText(action.name,
Config.global.theme.caption_width,
Config.global.theme.caption_height,
- Config.global.theme.caption_font);
+ Config.global.theme.caption_font,
+ Config.global.theme.caption_color,
+ Config.global.global_scale);
this.active_icon = new ThemedIcon(action.icon, true);
this.inactive_icon = new ThemedIcon(action.icon, false);
@@ -138,7 +140,8 @@ public class SliceRenderer : GLib.Object {
}
this.hotkey = new RenderedText(hotkey_label, (int)Config.global.theme.slice_radius*2,
- (int)Config.global.theme.slice_radius*2, "sans 20");
+ (int)Config.global.theme.slice_radius*2, "sans 20",
+ Config.global.theme.caption_color, Config.global.global_scale);
}
/////////////////////////////////////////////////////////////////////
@@ -185,6 +188,13 @@ public class SliceRenderer : GLib.Object {
/////////////////////////////////////////////////////////////////////
public void draw(double frame_time, Cairo.Context ctx, double angle, double distance) {
+
+ // update the AnimatedValues
+ this.scale.update(frame_time);
+ this.alpha.update(frame_time);
+ this.fade.update(frame_time);
+ this.fade_scale.update(frame_time);
+ this.fade_rotation.update(frame_time);
double direction = 2.0 * PI * position/parent.slice_count() + this.fade_rotation.val;
double max_scale = 1.0/Config.global.theme.max_zoom;
@@ -205,13 +215,6 @@ public class SliceRenderer : GLib.Object {
if (fabs(this.scale.end - max_scale) > Config.global.theme.max_zoom*0.005)
this.scale.reset_target(max_scale, Config.global.theme.transition_time);
- // update the AnimatedValues
- this.scale.update(frame_time);
- this.alpha.update(frame_time);
- this.fade.update(frame_time);
- this.fade_scale.update(frame_time);
- this.fade_rotation.update(frame_time);
-
ctx.save();
// distance from the center