Revert buggy pr (#28554)
Earlier, I merged #24723 Before merging it, I made a change that was incorrect and fast followed with a fix: #28548 Following that fix, @bennetbo discovered that the modals where no longer highlighting correctly, particularly the outline modal. So I'm going to revert it all. Release Notes: - N/A
This commit is contained in:
@@ -1666,7 +1666,7 @@ impl Interactivity {
|
||||
window: &mut Window,
|
||||
cx: &mut App,
|
||||
) {
|
||||
use crate::BorderStyle;
|
||||
use crate::{BorderStyle, TextAlign};
|
||||
|
||||
if global_id.is_some()
|
||||
&& (style.debug || style.debug_below || cx.has_global::<crate::DebugBelow>())
|
||||
@@ -1689,7 +1689,7 @@ impl Interactivity {
|
||||
.ok()
|
||||
.and_then(|mut text| text.pop())
|
||||
{
|
||||
text.paint(hitbox.origin, FONT_SIZE, None, None, window, cx)
|
||||
text.paint(hitbox.origin, FONT_SIZE, TextAlign::Left, None, window, cx)
|
||||
.ok();
|
||||
|
||||
let text_bounds = crate::Bounds {
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
use crate::{
|
||||
ActiveTooltip, AnyView, App, Bounds, DispatchPhase, Element, ElementId, GlobalElementId,
|
||||
HighlightStyle, Hitbox, IntoElement, LayoutId, MouseDownEvent, MouseMoveEvent, MouseUpEvent,
|
||||
Pixels, Point, SharedString, Size, TextAlign, TextOverflow, TextRun, TextStyle,
|
||||
TextStyleRefinement, TooltipId, WhiteSpace, Window, WrappedLine, WrappedLineLayout,
|
||||
register_tooltip_mouse_handlers, set_tooltip_on_window,
|
||||
Pixels, Point, SharedString, Size, TextOverflow, TextRun, TextStyle, TooltipId, WhiteSpace,
|
||||
Window, WrappedLine, WrappedLineLayout, register_tooltip_mouse_handlers, set_tooltip_on_window,
|
||||
};
|
||||
use anyhow::anyhow;
|
||||
use refineable::Refineable as _;
|
||||
use smallvec::SmallVec;
|
||||
use std::{
|
||||
cell::{Cell, RefCell},
|
||||
@@ -417,18 +415,12 @@ impl TextLayout {
|
||||
|
||||
let line_height = element_state.line_height;
|
||||
let mut line_origin = bounds.origin;
|
||||
|
||||
// Get current text_style refinements
|
||||
let mut text_style = TextStyleRefinement::default();
|
||||
for style in window.text_style_stack.iter().as_ref() {
|
||||
text_style.refine(&style);
|
||||
}
|
||||
|
||||
let text_style = window.text_style();
|
||||
for line in &element_state.lines {
|
||||
line.paint_background(
|
||||
line_origin,
|
||||
line_height,
|
||||
text_style.text_align.unwrap_or(TextAlign::Left),
|
||||
text_style.text_align,
|
||||
Some(bounds),
|
||||
window,
|
||||
cx,
|
||||
@@ -437,7 +429,7 @@ impl TextLayout {
|
||||
line.paint(
|
||||
line_origin,
|
||||
line_height,
|
||||
Some(&text_style),
|
||||
text_style.text_align,
|
||||
Some(bounds),
|
||||
window,
|
||||
cx,
|
||||
|
||||
Reference in New Issue
Block a user