This commit is contained in:
parent
3eeace0963
commit
22fe52c4a3
2 changed files with 16 additions and 5 deletions
|
|
@ -1382,6 +1382,16 @@ static void destroy_popup(MwLL r) {
|
|||
r->wayland.configured = MwFALSE;
|
||||
}
|
||||
|
||||
static void clip(MwLL handle){
|
||||
MwLL parent = handle->wayland.parent;
|
||||
|
||||
if(parent && handle->wayland.type == MWLL_WAYLAND_SUBLEVEL) {
|
||||
cairo_reset_clip(handle->wayland.cairo);
|
||||
cairo_rectangle(handle->wayland.cairo, 0, 0, parent->wayland.ww + handle->wayland.x, parent->wayland.wh + handle->wayland.y);
|
||||
cairo_clip(handle->wayland.cairo);
|
||||
}
|
||||
}
|
||||
|
||||
static void wl_logger(const char* fmt, va_list args) {
|
||||
vprintf(fmt, args);
|
||||
raise(SIGTRAP);
|
||||
|
|
@ -1562,6 +1572,9 @@ static void MwLLEndDrawImpl(MwLL handle) {
|
|||
|
||||
static void MwLLPolygonImpl(MwLL handle, MwPoint* points, int points_count, MwLLColor color) {
|
||||
int i;
|
||||
|
||||
clip(handle);
|
||||
|
||||
cairo_set_source_rgb(handle->wayland.cairo, color->common.red / 255.0, color->common.green / 255.0, color->common.blue / 255.0);
|
||||
cairo_new_path(handle->wayland.cairo);
|
||||
for(i = 0; i < points_count; i++) {
|
||||
|
|
@ -1721,15 +1734,11 @@ static void MwLLDestroyPixmapImpl(MwLLPixmap pixmap) {
|
|||
static void MwLLDrawPixmapImpl(MwLL handle, MwRect* rect, MwLLPixmap pixmap) {
|
||||
cairo_t* c;
|
||||
cairo_surface_t* cs;
|
||||
MwLL parent = handle->wayland.parent;
|
||||
|
||||
cs = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, rect->width, rect->height);
|
||||
c = cairo_create(cs);
|
||||
|
||||
if(parent) {
|
||||
cairo_rectangle(c, 0, 0, parent->wayland.ww + handle->wayland.x, parent->wayland.wh + handle->wayland.y);
|
||||
cairo_clip(c);
|
||||
}
|
||||
clip(handle);
|
||||
|
||||
cairo_scale(c, (double)rect->width / pixmap->common.width, (double)rect->height / pixmap->common.height);
|
||||
|
||||
|
|
|
|||
|
|
@ -815,6 +815,8 @@ void MwReparent(MwWidget handle, MwWidget new_parent) {
|
|||
arrput(new_parent->children, handle);
|
||||
|
||||
MwDispatch(handle->parent, children_update);
|
||||
|
||||
MwForceRender(handle);
|
||||
}
|
||||
|
||||
MwClass MwGetClass(MwWidget handle) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue