protected int focus_size;
protected int[] focus_starts;
protected bool focus_locked;
- protected double focus_centre;
+ protected int focus_centre;
public FisheyeList()
{
protected void focus_layout()
{
// Anchor point
- focus_centre = (double)cur_el*allocation.height/list.length;
+ focus_centre = cur_el*allocation.height/list.length;
focus_first = cur_el > focus_size/2 ? cur_el-focus_size/2 : 0;
focus_end = focus_first + focus_size;
protected void draw(Gdk.Drawable drawable)
{
Gtk.Style style = get_style();
- /*
- public enum StateType {
- NORMAL,
- ACTIVE,
- PRELIGHT,
- SELECTED,
- INSENSITIVE
- }
- style.bg[Gtk.StateType.NORMAL];
- */
-
// Background
drawable.draw_rectangle(style.bg_gc[Gtk.StateType.NORMAL], true, 0, 0, allocation.width, allocation.height);
var fd = style.font_desc.copy();
//fd.set_size((y1-y0)*Pango.SCALE);
- fd.set_absolute_size((y1-y0)*Pango.SCALE*80/100);
+ int size = (y1-y0)*Pango.SCALE*80/100;
+ if (size <= 0) size = Pango.SCALE;
+ fd.set_absolute_size(size);
layout.set_font_description(fd);
//stderr.printf("AZAZA %p\n", layout.get_attributes());
//var attrlist = layout.get_attributes().copy();
* @param max the end of the display
* @return the distorted coordinate
*/
- private double fisheye(double x, double a, double d, double min, double max)
+ private double fisheye(double x, int a, double d, int min, int max)
{
if ( d != 0 ) {
bool left = x<a;
double v;
- double m = (left ? a-min : max-a);
+ int m = (left ? a-min : max-a);
if ( m == 0 ) m = max-min;
v = Math.fabs(x - a) / m;
v = (d+1)/(d+(1/v));