Closed
Description
Is your feature request related to a problem? Please describe.
Lines 173 to 184 in 4a9516e
Describe the solution you'd like
Remove DrawBorder() function and use FlashPaintArea()
instead, this function should do the following:
- Save the repainting area and its paint time into a list.
record.rect = paint_rect; record.paint_time = clock(); LinkedList_Append(&list, &record);
- Create a timer to repaint each highlighted area of the list every 10 milliseconds.
int timer = LCUI_SetInterval(10, OnUpdateHighlightArea, NULL);
- Check the paint time of the highlighted area:
if (clock() - record.paint_time >= duration) { // remove record and get next area. }
- Fill the repainted area with the corresponding transparency color based on the current time:
- Create a bitmap named
mask
:LCUI_Graph mask; Graph_Init(&mask); mask.color_type = LCUI_COLOR_TYPE_ARGB; Graph_Create(&mask, record.rect.width, record.rect.height);
- Fill color into
mask
:Graph_FillRect(&mask, NULL, RGBA(255, 0, 0, 200), TRUE);
- Paint a border to the
mask
. Refer the DrawBorder() function - Compute
mask
opacity:mask.opactiy = 1.0 * (record.paint_time + duration - clock()) / duration;
- Render the original content of the painting area and blend
mask
into the canvas:paint = Surface_BeginPaint(s, paint_rect); Widget_Render(record->widget, paint); Graph_Mix(&paint->canvas, &mask); Surface_EndPaint(s, paint);
- Create a bitmap named
The final effect should be the same as the paint flashing of Google Chrome:
Describe alternatives you've considered
None.
Additional context
None.
IssueHunt Summary
vbalyasnyy has been rewarded.
Backers (Total: $10.00)
lc-soft ($10.00)
Submitted pull Requests
Tips
- Checkout the Issuehunt explorer to discover more funded issues.
- Need some help from other developers? Add your repositories on IssueHunt to raise funds.
IssueHunt has been backed by the following sponsors. Become a sponsor
Activity