Skip to content

Commit

Permalink
[Added] Rounded corners for ePixmap. Thanks @jbleyel
Browse files Browse the repository at this point in the history
DimitarCC authored and Huevos committed Feb 3, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 7eb5da0 commit 8ffaeca
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/gui/epixmap.cpp
Original file line number Diff line number Diff line change
@@ -91,6 +91,8 @@ int ePixmap::event(int event, void *data, void *data2)
// eWidget::event(event, data, data2);

gPainter &painter = *(gPainter*)data2;
int cornerRadius = getCornerRadius();

if (m_pixmap)
{
int flags = 0;
@@ -102,9 +104,14 @@ int ePixmap::event(int event, void *data, void *data2)
flags = gPainter::BT_ALPHABLEND;
if (m_scale)
flags |= gPainter::BT_SCALE;

painter.setRadius(cornerRadius, getCornerRadiusEdges());
painter.blit(m_pixmap, eRect(ePoint(0, 0), s), eRect(), flags);
}

if(cornerRadius)
return 0; // border not suppored for rounded edges

if (m_have_border_color)
painter.setForegroundColor(m_border_color);

0 comments on commit 8ffaeca

Please sign in to comment.