private string[] list;
protected int cur_el;
- protected double distortion_factor;
+ protected int _distortion_factor;
+ public int distortion_factor {
+ get { return _distortion_factor; }
+ set {
+ _distortion_factor = value;
+ focus_layout_needed = true;
+ }
+ }
+
+
+ // Pango layouts cached for speed
+ // TODO: If you create and keep a PangoLayout using this context, you
+ // must deal with changes to the context by calling
+ // pango_layout_context_changed() on the layout in response to the
+ // "style-set" and "direction-changed" signals for the widget.
protected Pango.Layout[] pango_cache;
- // Number of items shown before and after the focus element
+ // Layout information
protected int focus_first;
protected int focus_end;
protected int[] focus_starts;
for (int i = 0; i < 30; ++i)
pango_cache[i] = null;
+ // Defaults for properties
+ focus_size = 20;
+ distortion_factor = 30;
+
cur_el = 0;
focus_centre = 0;
- focus_size = 20;
focus_locked = false;
- distortion_factor = 30;
add_events(Gdk.EventMask.POINTER_MOTION_MASK
| Gdk.EventMask.BUTTON_PRESS_MASK
* @param max the end of the display
* @return the distorted coordinate
*/
- private int fisheye(int x, int a, double d, int min, int max)
+ private int fisheye(int x, int a, int d, int min, int max)
{
if ( d != 0 ) {
bool left = x<a;
int m = (left ? a-min : max-a);
if ( m == 0 ) m = max-min;
v = (double)(x - a).abs() / m;
- v = (d+1)/(d+(1/v));
+ v = (double)(d+1)/(d+(1/v));
return (int)Math.round((left?-1:1)*m*v + a);
} else {
return x;