Merge branch 'main' into main
This commit is contained in:
commit
012483675d
@ -49,7 +49,7 @@ image = { version = "0.25.2", default-features = false }
|
|||||||
# misc
|
# misc
|
||||||
bitflags = { version = "2.3", features = ["serde"] }
|
bitflags = { version = "2.3", features = ["serde"] }
|
||||||
bytemuck = { version = "1.5" }
|
bytemuck = { version = "1.5" }
|
||||||
wgpu = { version = "23", default-features = false }
|
wgpu = { version = "23.0.1", default-features = false }
|
||||||
serde = { version = "1", features = ["derive"] }
|
serde = { version = "1", features = ["derive"] }
|
||||||
derive_more = { version = "1", default-features = false, features = [
|
derive_more = { version = "1", default-features = false, features = [
|
||||||
"error",
|
"error",
|
||||||
|
@ -24,7 +24,7 @@ bevy_utils = { path = "../bevy_utils", version = "0.15.0-dev" }
|
|||||||
# misc
|
# misc
|
||||||
bitflags = { version = "2.3", features = ["serde"] }
|
bitflags = { version = "2.3", features = ["serde"] }
|
||||||
bytemuck = { version = "1.5" }
|
bytemuck = { version = "1.5" }
|
||||||
wgpu = { version = "23", default-features = false }
|
wgpu = { version = "23.0.1", default-features = false }
|
||||||
serde = { version = "1", features = ["derive"] }
|
serde = { version = "1", features = ["derive"] }
|
||||||
hexasphere = "15.0"
|
hexasphere = "15.0"
|
||||||
derive_more = { version = "1", default-features = false, features = [
|
derive_more = { version = "1", default-features = false, features = [
|
||||||
|
@ -68,7 +68,7 @@ codespan-reporting = "0.11.0"
|
|||||||
# It is enabled for now to avoid having to do a significant overhaul of the renderer just for wasm.
|
# It is enabled for now to avoid having to do a significant overhaul of the renderer just for wasm.
|
||||||
# When the 'atomics' feature is enabled `fragile-send-sync-non-atomic` does nothing
|
# When the 'atomics' feature is enabled `fragile-send-sync-non-atomic` does nothing
|
||||||
# and Bevy instead wraps `wgpu` types to verify they are not used off their origin thread.
|
# and Bevy instead wraps `wgpu` types to verify they are not used off their origin thread.
|
||||||
wgpu = { version = "23", default-features = false, features = [
|
wgpu = { version = "23.0.1", default-features = false, features = [
|
||||||
"wgsl",
|
"wgsl",
|
||||||
"dx12",
|
"dx12",
|
||||||
"metal",
|
"metal",
|
||||||
|
@ -107,6 +107,12 @@ impl TextPipeline {
|
|||||||
computed.entities.clear();
|
computed.entities.clear();
|
||||||
|
|
||||||
for (span_index, (entity, depth, span, text_font, color)) in text_spans.enumerate() {
|
for (span_index, (entity, depth, span, text_font, color)) in text_spans.enumerate() {
|
||||||
|
// Save this span entity in the computed text block.
|
||||||
|
computed.entities.push(TextEntity { entity, depth });
|
||||||
|
|
||||||
|
if span.is_empty() {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
// Return early if a font is not loaded yet.
|
// Return early if a font is not loaded yet.
|
||||||
if !fonts.contains(text_font.font.id()) {
|
if !fonts.contains(text_font.font.id()) {
|
||||||
spans.clear();
|
spans.clear();
|
||||||
@ -122,9 +128,6 @@ impl TextPipeline {
|
|||||||
return Err(TextError::NoSuchFont);
|
return Err(TextError::NoSuchFont);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save this span entity in the computed text block.
|
|
||||||
computed.entities.push(TextEntity { entity, depth });
|
|
||||||
|
|
||||||
// Get max font size for use in cosmic Metrics.
|
// Get max font size for use in cosmic Metrics.
|
||||||
font_size = font_size.max(text_font.font_size);
|
font_size = font_size.max(text_font.font_size);
|
||||||
|
|
||||||
|
@ -197,16 +197,19 @@ pub fn ui_focus_system(
|
|||||||
else {
|
else {
|
||||||
return None;
|
return None;
|
||||||
};
|
};
|
||||||
|
let window = windows.get(window_ref.entity()).ok()?;
|
||||||
|
|
||||||
let viewport_position = camera
|
let viewport_position = camera
|
||||||
.physical_viewport_rect()
|
.physical_viewport_rect()
|
||||||
.map(|rect| rect.min.as_vec2())
|
.map(|rect| rect.min.as_vec2())
|
||||||
.unwrap_or_default();
|
.unwrap_or_default();
|
||||||
windows
|
window
|
||||||
.get(window_ref.entity())
|
.physical_cursor_position()
|
||||||
.ok()
|
.or_else(|| {
|
||||||
.and_then(Window::physical_cursor_position)
|
touches_input
|
||||||
.or_else(|| touches_input.first_pressed_position())
|
.first_pressed_position()
|
||||||
|
.map(|pos| pos * window.scale_factor())
|
||||||
|
})
|
||||||
.map(|cursor_position| (entity, cursor_position - viewport_position))
|
.map(|cursor_position| (entity, cursor_position - viewport_position))
|
||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
|
@ -2191,10 +2191,10 @@ impl BorderRadius {
|
|||||||
bottom_left: f32,
|
bottom_left: f32,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
Self {
|
Self {
|
||||||
top_left: Val::Px(top_left),
|
top_left: Val::Percent(top_left),
|
||||||
top_right: Val::Px(top_right),
|
top_right: Val::Percent(top_right),
|
||||||
bottom_right: Val::Px(bottom_right),
|
bottom_right: Val::Percent(bottom_right),
|
||||||
bottom_left: Val::Px(bottom_left),
|
bottom_left: Val::Percent(bottom_left),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user