Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
Bevy Cosmic Edit
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Microhacks
Bevy Forks
Bevy Cosmic Edit
Commits
9d8ad4fb
Commit
9d8ad4fb
authored
1 year ago
by
sam edelsten
Browse files
Options
Downloads
Patches
Plain Diff
fix broken text selection on percentage sized ui nodes
parent
1c929dc0
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
TODO
+7
-10
7 additions, 10 deletions
TODO
src/lib.rs
+3
-7
3 additions, 7 deletions
src/lib.rs
with
10 additions
and
17 deletions
TODO
+
7
−
10
View file @
9d8ad4fb
...
...
@@ -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
This diff is collapsed.
Click to expand it.
src/lib.rs
+
3
−
7
View file @
9d8ad4fb
...
...
@@ -652,7 +652,7 @@ pub fn cosmic_edit_bevy_events(
With
<
CosmicEditor
>
,
>
,
readonly_query
:
Query
<&
ReadOnly
>
,
styl
e_query
:
Query
<&
mut
Styl
e
>
,
nod
e_query
:
Query
<&
mut
Nod
e
>
,
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
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment