Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset a65b0c8 in mainline


Ignore:
Timestamp:
2020-06-08T18:18:40Z (4 weeks ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
84e74ea
Parents:
8aef01c
Message:

Preview window with a non-filled rectangle

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/display/window.c

    r8aef01c ra65b0c8  
    247247        gfx_color_t *color;
    248248        gfx_rect_t prect;
    249         gfx_rect_t drect;
     249        gfx_rect_t dr;
     250        gfx_rect_t pr;
    250251        gfx_context_t *gc;
    251 
    252         log_msg(LOG_DEFAULT, LVL_DEBUG, "ds_window_paint_preview");
    253252
    254253        /*
     
    262261        }
    263262
    264         /* Clip rendering to the clipping rectangle */
    265         gfx_rect_clip(&prect, rect, &drect);
     263        log_msg(LOG_DEFAULT, LVL_DEBUG, "ds_window_paint_preview");
     264        prect.p0.x, prect.p0.y, prect.p1.x, prect.p1.y);
    266265
    267266        rc = gfx_color_new_rgb_i16(0xffff, 0xffff, 0xffff, &color);
     
    272271        if (gc != NULL) {
    273272                gfx_set_color(gc, color);
    274                 gfx_fill_rect(gc, &drect);
     273
     274                /*
     275                 * TODO: Ideally we'd want XOR operation to make the preview
     276                 * frame visible on any background. If we wanted to get really
     277                 * fancy, we'd fill it with a pattern
     278                 */
     279
     280                pr.p0.x = prect.p0.x;
     281                pr.p0.y = prect.p0.y;
     282                pr.p1.x = prect.p1.x;
     283                pr.p1.y = prect.p0.y + 1;
     284                gfx_rect_clip(&pr, rect, &dr);
     285                gfx_fill_rect(gc, &dr);
     286
     287                pr.p0.x = prect.p0.x;
     288                pr.p0.y = prect.p1.y - 1;
     289                pr.p1.x = prect.p1.x;
     290                pr.p1.y = prect.p1.y;
     291                gfx_rect_clip(&pr, rect, &dr);
     292                gfx_fill_rect(gc, &dr);
     293
     294                pr.p0.x = prect.p0.x;
     295                pr.p0.y = prect.p0.y;
     296                pr.p1.x = prect.p0.x + 1;
     297                pr.p1.y = prect.p1.y;
     298                gfx_rect_clip(&pr, rect, &dr);
     299                gfx_fill_rect(gc, &dr);
     300
     301                pr.p0.x = prect.p1.x - 1;
     302                pr.p0.y = prect.p0.y;
     303                pr.p1.x = prect.p1.x;
     304                pr.p1.y = prect.p1.y;
     305                gfx_rect_clip(&pr, rect, &dr);
     306                gfx_fill_rect(gc, &dr);
     307
    275308        }
    276309
Note: See TracChangeset for help on using the changeset viewer.