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
f69ff657
Commit
f69ff657
authored
2 years ago
by
John Mitchell
Browse files
Options
Downloads
Patches
Plain Diff
Fixed text color extraction.
parent
ccf067d2
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
examples/text.rs
+1
-0
1 addition, 0 deletions
examples/text.rs
src/render/font/extract.rs
+2
-2
2 additions, 2 deletions
src/render/font/extract.rs
src/render_primitive.rs
+2
-1
2 additions, 1 deletion
src/render_primitive.rs
with
5 additions
and
3 deletions
examples/text.rs
+
1
−
0
View file @
f69ff657
...
@@ -18,6 +18,7 @@ fn my_widget_1_render(
...
@@ -18,6 +18,7 @@ fn my_widget_1_render(
// Note: We will see two updates because of the mutable change to styles.
// Note: We will see two updates because of the mutable change to styles.
// Which means when foo changes MyWidget will render twice!
// Which means when foo changes MyWidget will render twice!
*
computed_styles
=
KStyle
{
*
computed_styles
=
KStyle
{
color
:
Color
::
RED
.into
(),
render_command
:
StyleProp
::
Value
(
RenderCommand
::
Text
{
render_command
:
StyleProp
::
Value
(
RenderCommand
::
Text
{
content
:
format!
(
"My number is: {}"
,
my_widget
.foo
),
content
:
format!
(
"My number is: {}"
,
my_widget
.foo
),
alignment
:
Alignment
::
Start
,
alignment
:
Alignment
::
Start
,
...
...
This diff is collapsed.
Click to expand it.
src/render/font/extract.rs
+
2
−
2
View file @
f69ff657
...
@@ -13,7 +13,7 @@ use super::font_mapping::FontMapping;
...
@@ -13,7 +13,7 @@ use super::font_mapping::FontMapping;
pub
fn
extract_texts
(
pub
fn
extract_texts
(
camera_entity
:
Entity
,
camera_entity
:
Entity
,
background_
color
:
Color
,
color
:
Color
,
text_layout
:
TextLayout
,
text_layout
:
TextLayout
,
layout
:
crate
::
layout
::
Rect
,
layout
:
crate
::
layout
::
Rect
,
font
:
String
,
font
:
String
,
...
@@ -51,7 +51,7 @@ pub fn extract_texts(
...
@@ -51,7 +51,7 @@ pub fn extract_texts(
min
:
position
,
min
:
position
,
max
:
position
+
size
,
max
:
position
+
size
,
},
},
color
:
background_
color
,
color
,
char_id
:
font
.get_char_id
(
glyph_rect
.content
)
.unwrap
(),
char_id
:
font
.get_char_id
(
glyph_rect
.content
)
.unwrap
(),
z_index
:
layout
.z_index
,
z_index
:
layout
.z_index
,
quad_type
:
if
subpixel
||
forced
{
quad_type
:
if
subpixel
||
forced
{
...
...
This diff is collapsed.
Click to expand it.
src/render_primitive.rs
+
2
−
1
View file @
f69ff657
...
@@ -117,9 +117,10 @@ impl RenderPrimitive for KStyle {
...
@@ -117,9 +117,10 @@ impl RenderPrimitive for KStyle {
let
font
=
self
let
font
=
self
.font
.font
.resolve_or_else
(||
String
::
from
(
crate
::
DEFAULT_FONT
));
.resolve_or_else
(||
String
::
from
(
crate
::
DEFAULT_FONT
));
let
color
=
self
.color
.resolve_or
(
Color
::
WHITE
);
let
text
=
crate
::
render
::
font
::
extract_texts
(
let
text
=
crate
::
render
::
font
::
extract_texts
(
camera_entity
,
camera_entity
,
background_
color
,
color
,
text_layout
,
text_layout
,
*
layout
,
*
layout
,
font
,
font
,
...
...
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