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
0e5e54f7
Commit
0e5e54f7
authored
2 years ago
by
sam edelsten
Browse files
Options
Downloads
Patches
Plain Diff
fix dropped metrics causing scaling issues
parent
db074eb6
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
-3
7 additions, 3 deletions
TODO
src/lib.rs
+10
-2
10 additions, 2 deletions
src/lib.rs
with
17 additions
and
5 deletions
TODO
+
7
−
3
View file @
0e5e54f7
...
...
@@ -3,6 +3,10 @@
BUGS INTRODUCED:
[ ] Font size has been changed somehow
[ ] No cursor on readonly
[ ] Window resizing broken
\ No newline at end of file
[ ] Cursor on readonly
[ ] Window resizing broken
Used to redraw on click, now redraws on scroll or drag?
BUGS SQUASHED:
[x] Font size has been changed somehow
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/lib.rs
+
10
−
2
View file @
0e5e54f7
...
...
@@ -71,10 +71,13 @@ impl Default for CosmicEditor {
/// Adds the font system to each editor when added
fn
cosmic_editor_builder
(
mut
added_editors
:
Query
<
(
&
mut
CosmicEditor
,
&
CosmicAttrs
),
Added
<
CosmicEditor
>>
,
mut
added_editors
:
Query
<
(
&
mut
CosmicEditor
,
&
CosmicAttrs
,
&
CosmicMetrics
),
Added
<
CosmicEditor
>
,
>
,
mut
font_system
:
ResMut
<
CosmicFontSystem
>
,
)
{
for
(
mut
editor
,
attrs
)
in
added_editors
.iter_mut
()
{
for
(
mut
editor
,
attrs
,
metrics
)
in
added_editors
.iter_mut
()
{
// keep old text if set
let
mut
text
=
get_cosmic_text
(
editor
.0
.buffer
());
...
...
@@ -89,6 +92,11 @@ fn cosmic_editor_builder(
Shaping
::
Advanced
,
);
editor
.0
.buffer_mut
()
.set_metrics
(
&
mut
font_system
.0
,
Metrics
::
new
(
metrics
.font_size
,
metrics
.line_height
)
.scale
(
metrics
.scale_factor
),
);
editor
.0
.buffer_mut
()
// TODO size here????
...
...
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