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
70a53888
Commit
70a53888
authored
1 year ago
by
sam edelsten
Browse files
Options
Downloads
Patches
Plain Diff
possible scale fix for HiDPI screens
i need a higher pixel count to be sure
parent
7e79c210
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/render.rs
+24
-4
24 additions, 4 deletions
src/render.rs
with
24 additions
and
4 deletions
src/render.rs
+
24
−
4
View file @
70a53888
...
...
@@ -463,13 +463,33 @@ pub(crate) fn hide_inactive_or_readonly_cursor(
pub
(
crate
)
fn
set_initial_scale
(
window_q
:
Query
<&
Window
,
With
<
PrimaryWindow
>>
,
mut
metrics_q
:
Query
<&
mut
CosmicMetrics
,
Added
<
CosmicMetrics
>>
,
mut
cosmic_query
:
Query
<
(
Option
<&
mut
CosmicEditor
>
,
&
mut
CosmicMetrics
,
Option
<&
mut
XOffset
>
,
),
Added
<
CosmicMetrics
>
,
>
,
mut
font_system
:
ResMut
<
CosmicFontSystem
>
,
)
{
let
scale
=
window_q
.single
()
.scale_factor
()
as
f32
;
for
mut
metrics
in
metrics_q
.iter_mut
()
{
if
metrics
.scale_factor
==
DEFAULT_SCALE_PLACEHOLDER
{
metrics
.scale_factor
=
scale
;
for
(
editor
,
mut
metrics
,
x_offset
)
in
&
mut
cosmic_query
.iter_mut
()
{
if
metrics
.scale_factor
!=
DEFAULT_SCALE_PLACEHOLDER
{
continue
;
}
let
font_system
=
&
mut
font_system
.0
;
metrics
.scale_factor
=
scale
;
let
metrics
=
Metrics
::
new
(
metrics
.font_size
,
metrics
.line_height
)
.scale
(
scale
);
if
let
Some
(
mut
editor
)
=
editor
{
editor
.0
.buffer_mut
()
.set_metrics
(
font_system
,
metrics
);
editor
.0
.buffer_mut
()
.set_redraw
(
true
);
}
if
let
Some
(
mut
x_offset
)
=
x_offset
{
*
x_offset
=
XOffset
(
None
);
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Louis
@louis
mentioned in commit
5c277869
·
2 months ago
mentioned in commit
5c277869
mentioned in commit 5c2778699e2318adebe483befc4e939083d21d0c
Toggle commit list
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