Skip to content
Snippets Groups Projects
Commit 9d8ad4fb authored by sam edelsten's avatar sam edelsten
Browse files

fix broken text selection on percentage sized ui nodes

parent 1c929dc0
No related branches found
No related tags found
No related merge requests found
......@@ -3,16 +3,6 @@
BUGS INTRODUCED:
[ ] Cannot select text on Ui bundles sized by percentage
Maybe intercept percentages and set as px on instantiation?
Replace evaluate() with custom percent to px fn?
Read into how evaluate() works
[ ] Window resizing broken
Used to redraw on click, now redraws on scroll or drag?
Now drag doesn't work either (tested on readonly, might be that)
Either way redraw on resize would be nice.
[ ] Not all text boxes want to be click-selectable
Make utils.rs in examples; move click functions there.
......@@ -23,3 +13,10 @@ BUGS SQUASHED:
[x] Cursor on readonly
[x] MultiStyle text is fully dead. Idk what I did to it :(
[x] Cannot select text on Ui bundles sized by percentage
[x] Window resizing broken
Used to redraw on click, now redraws on scroll or drag?
Now drag doesn't work either (tested on readonly, might be that)
fixed by percentage-select fix
......@@ -652,7 +652,7 @@ pub fn cosmic_edit_bevy_events(
With<CosmicEditor>,
>,
readonly_query: Query<&ReadOnly>,
style_query: Query<&mut Style>,
node_query: Query<&mut Node>,
sprite_query: Query<&mut Sprite>,
mut font_system: ResMut<CosmicFontSystem>,
mut is_deleting: Local<bool>,
......@@ -669,12 +669,8 @@ pub fn cosmic_edit_bevy_events(
{
let readonly = readonly_query.get(entity).is_ok();
let (width, height, is_ui_node) = match style_query.get(entity) {
Ok(style) => (
style.width.evaluate(1.).unwrap_or(1.),
style.height.evaluate(1.).unwrap_or(1.),
true,
),
let (width, height, is_ui_node) = match node_query.get(entity) {
Ok(node) => (node.size().x, node.size().y, true),
Err(_) => {
let sprite = sprite_query.get(entity).unwrap();
let size = sprite.custom_size.unwrap();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment