Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kayak UI 0.11
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
Kayak UI 0.11
Commits
cbbb034c
Commit
cbbb034c
authored
2 years ago
by
John Mitchell
Browse files
Options
Downloads
Patches
Plain Diff
text box should recalculate graphemes when value changes.
parent
c60c3113
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/widgets/text_box.rs
+13
-1
13 additions, 1 deletion
src/widgets/text_box.rs
with
13 additions
and
1 deletion
src/widgets/text_box.rs
+
13
−
1
View file @
cbbb034c
...
@@ -121,9 +121,22 @@ pub fn text_box_render(
...
@@ -121,9 +121,22 @@ pub fn text_box_render(
}
}
}
}
let
style_font
=
styles
.font
.clone
();
if
is_different
{
if
is_different
{
if
let
Ok
(
mut
state
)
=
state_query
.p1
()
.get_mut
(
state_entity
)
{
if
let
Ok
(
mut
state
)
=
state_query
.p1
()
.get_mut
(
state_entity
)
{
state
.current_value
=
text_box
.value
.clone
();
state
.current_value
=
text_box
.value
.clone
();
// Update graphemes
set_graphemes
(
&
mut
state
,
&
font_assets
,
&
font_mapping
,
&
style_font
);
state
.cursor_position
=
state
.graphemes
.len
();
set_new_cursor_position
(
&
mut
state
,
&
font_assets
,
&
font_mapping
,
&
style_font
,
);
}
}
}
}
...
@@ -161,7 +174,6 @@ pub fn text_box_render(
...
@@ -161,7 +174,6 @@ pub fn text_box_render(
};
};
let
cloned_on_change
=
on_change
.clone
();
let
cloned_on_change
=
on_change
.clone
();
let
style_font
=
styles
.font
.clone
();
*
on_event
=
OnEvent
::
new
(
*
on_event
=
OnEvent
::
new
(
move
|
In
((
event_dispatcher_context
,
_
,
mut
event
,
_entity
)):
In
<
(
move
|
In
((
event_dispatcher_context
,
_
,
mut
event
,
_entity
)):
In
<
(
...
...
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