On Thu, Sep 22, 2011 at 11:13:30AM +0100, Daniel Stone wrote:
> Hi,
>
> On Mon, Aug 22, 2011 at 03:35:27PM +1000, Peter Hutterer wrote:
> > + if (*current_ax != -1 && axnum != *current_ax)
> > + {
> > + ax = &dev->valuator->axes[*current_ax];
> > + if (ax->scroll.type == type && (flags & SCROLL_FLAG_PREFERRED) ==
> > (ax->scroll.flags & SCROLL_FLAG_PREFERRED))
> > + return FALSE;
> > + }
>
> Very long line.
>
> > + switch(axis->scroll.type)
> > + {
> > + case SCROLL_TYPE_VERTICAL: info->scroll_type =
> > XIScrollTypeVertical; break;
> > + case SCROLL_TYPE_HORIZONTAL: info->scroll_type =
> > XIScrollTypeHorizontal; break;
> > + default:
> > + ErrorF("[Xi] Unknown scroll type %d. This is a bug.\n",
> > axis->scroll.type);
> > + break;
> > + }
>
> Ugh, style!
>
> > + while (fabs(delta) >= fabs(incr))
> > + {
> > + int b = ax->scroll.type == SCROLL_TYPE_VERTICAL ? 4 : 6;
> > + [...]
> > + else if (delta >= incr) {
> > + delta -= incr;
> > + b++;
> > + }
>
> This is very clever, but subtle, so probably wants a comment.
it's also very broken, so probably wants fixing ;)
Cheers,
Peter
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel