Skip to content

Commit 28f9fba

Browse files
committed
Hit-testing works again
1 parent 9fcf485 commit 28f9fba

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

azul-desktop/src/wr_translate.rs

+37
Original file line numberDiff line numberDiff line change
@@ -1644,6 +1644,19 @@ fn push_frame(
16441644
None => WrClipId::root(builder.pipeline_id), // no clipping
16451645
};
16461646

1647+
// push the hit-testing tag if any
1648+
if let Some(hit_tag) = frame.tag {
1649+
builder.push_hit_test(&WrCommonItemProperties {
1650+
clip_rect: WrLayoutRect::new(
1651+
WrLayoutPoint::new(0.0, 0.0),
1652+
WrLayoutSize::new(frame.size.width, frame.size.height),
1653+
),
1654+
spatial_id: rect_spatial_id,
1655+
clip_id: parent_clip_id,
1656+
flags: WrPrimitiveFlags::empty(),
1657+
}, (hit_tag.0, 0));
1658+
}
1659+
16471660
// if let Some(image_mask) -> define_image_mask_clip()
16481661
for child in frame.children {
16491662
push_display_list_msg(document_id, render_api, builder, child, rect_spatial_id, children_clip_id, positioned_items, current_hidpi_factor);
@@ -1712,6 +1725,30 @@ fn push_scroll_frame(
17121725
),
17131726
);
17141727

1728+
// push the scroll hit-testing tag if any
1729+
builder.push_hit_test(&WrCommonItemProperties {
1730+
clip_rect: WrLayoutRect::new(
1731+
WrLayoutPoint::new(0.0, 0.0),
1732+
WrLayoutSize::new(scroll_frame.content_rect.size.width, scroll_frame.content_rect.size.height),
1733+
),
1734+
spatial_id: scroll_frame_clip_info.spatial_id,
1735+
clip_id: scroll_frame_clip_info.clip_id,
1736+
flags: WrPrimitiveFlags::empty(),
1737+
}, (scroll_frame.scroll_tag.0.0, 0));
1738+
1739+
// additionally push the hit tag of the frame if there is any
1740+
if let Some(hit_tag) = scroll_frame.frame.tag {
1741+
builder.push_hit_test(&WrCommonItemProperties {
1742+
clip_rect: WrLayoutRect::new(
1743+
WrLayoutPoint::new(0.0, 0.0),
1744+
WrLayoutSize::new(scroll_frame.frame.size.width, scroll_frame.frame.size.height),
1745+
),
1746+
spatial_id: scroll_frame_clip_info.spatial_id,
1747+
clip_id: scroll_frame_clip_info.clip_id,
1748+
flags: WrPrimitiveFlags::empty(),
1749+
}, (hit_tag.0, 0));
1750+
}
1751+
17151752
for child in scroll_frame.frame.children {
17161753
push_display_list_msg(
17171754
document_id,

0 commit comments

Comments
 (0)