diff --git a/masonry/src/widget/label.rs b/masonry/src/widget/label.rs index 31f99f638..a401bb498 100644 --- a/masonry/src/widget/label.rs +++ b/masonry/src/widget/label.rs @@ -413,15 +413,16 @@ impl Widget for Label { Role::Label } - fn accessibility(&mut self, _ctx: &mut AccessCtx, node: &mut Node) { + fn accessibility(&mut self, ctx: &mut AccessCtx, node: &mut Node) { + let window_origin = ctx.window_origin(); self.accessibility.build_nodes( self.text.as_ref(), &self.text_layout, - _ctx.tree_update, + ctx.tree_update, node, || NodeId::from(WidgetId::next()), - LABEL_X_PADDING, - 0.0, + (window_origin.x + LABEL_X_PADDING) * ctx.scale_factor, + window_origin.y * ctx.scale_factor, ); } diff --git a/masonry/src/widget/text_area.rs b/masonry/src/widget/text_area.rs index 4517009dc..cbe12a25f 100644 --- a/masonry/src/widget/text_area.rs +++ b/masonry/src/widget/text_area.rs @@ -835,15 +835,22 @@ impl Widget for TextArea { } fn accessibility(&mut self, ctx: &mut AccessCtx, node: &mut Node) { + if !EDITABLE { + node.set_read_only(); + } let (fctx, lctx) = ctx.text_contexts(); let is_rtl = self.editor.layout(fctx, lctx).is_rtl(); - let (x_offset, y_offset) = (self.padding.get_left(is_rtl), self.padding.top); + let origin = ctx.window_origin(); + let (x_offset, y_offset) = ( + origin.x + self.padding.get_left(is_rtl), + origin.y + self.padding.top, + ); self.editor.accessibility( ctx.tree_update, node, || NodeId::from(WidgetId::next()), - x_offset, - y_offset, + ctx.scale_factor * x_offset, + ctx.scale_factor * y_offset, ); }