Changeset 5ef85c0 in mainline for uspace/lib/ui/src


Ignore:
Timestamp:
2022-03-17T12:16:03Z (3 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1026cc4
Parents:
71edd430
git-author:
Jiri Svoboda <jiri@…> (2022-03-16 19:15:43)
git-committer:
Jiri Svoboda <jiri@…> (2022-03-17 12:16:03)
Message:

Scrollbar unit tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ui/src/scrollbar.c

    r71edd430 r5ef85c0  
    4949#include "../private/scrollbar.h"
    5050
    51 /*
    52  * The kind reader will appreciate that scrollbar thumb dimensions 23:15
    53  * are chosen such that, after subtracting the frame width (2 times 1),
    54  * we get 21:13, which is a good approximation of the golden ratio.
    55  */
    5651enum {
    5752        /** Scrollbar button width */
     
    471466        w = scrollbar->rect.p1.x - scrollbar->rect.p0.x -
    472467            2 * ui_scrollbar_btn_len_text;
     468        assert(w >= 0);
     469        if (w < 0)
     470                return EINVAL;
     471
    473472        gchar = "\u2592";
    474473        gcharsz = str_size(gchar);
Note: See TracChangeset for help on using the changeset viewer.