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
ab1c63e1
Commit
ab1c63e1
authored
3 years ago
by
StarArawn
Browse files
Options
Downloads
Patches
Plain Diff
Fixed DPI issues yet again.
parent
cd3a843c
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
bevy_kayak_ui/src/render/unified/mod.rs
+4
-1
4 additions, 1 deletion
bevy_kayak_ui/src/render/unified/mod.rs
bevy_kayak_ui/src/render/unified/pipeline.rs
+5
-1
5 additions, 1 deletion
bevy_kayak_ui/src/render/unified/pipeline.rs
with
9 additions
and
2 deletions
bevy_kayak_ui/src/render/unified/mod.rs
+
4
−
1
View file @
ab1c63e1
...
...
@@ -62,6 +62,8 @@ impl Plugin for UnifiedRenderPlugin {
}
}
pub
struct
Dpi
(
f32
);
pub
fn
extract
(
mut
commands
:
Commands
,
context
:
Res
<
BevyContext
>
,
...
...
@@ -110,7 +112,7 @@ pub fn extract(
extracted_quads
.push
(
ExtractQuadBundle
{
extracted_quad
:
ExtractedQuad
{
rect
:
Rect
{
min
:
Vec2
::
new
(
layout
.posx
,
layout
.posy
),
min
:
Vec2
::
new
(
layout
.posx
,
layout
.posy
)
*
dpi
,
max
:
Vec2
::
new
(
layout
.posx
+
layout
.width
,
layout
.posy
+
layout
.height
)
*
dpi
,
},
...
...
@@ -133,5 +135,6 @@ pub fn extract(
}
commands
.insert_resource
(
window_size
.get
());
commands
.insert_resource
(
Dpi
(
dpi
));
commands
.spawn_batch
(
extracted_quads
);
}
This diff is collapsed.
Click to expand it.
bevy_kayak_ui/src/render/unified/pipeline.rs
+
5
−
1
View file @
ab1c63e1
...
...
@@ -28,12 +28,13 @@ use bevy::{
},
sprite
::
Rect
,
utils
::
HashMap
,
window
::
Windows
,
};
use
bytemuck
::{
Pod
,
Zeroable
};
use
crevice
::
std140
::
AsStd140
;
use
kayak_font
::{
FontRenderingPipeline
,
FontTextureCache
,
KayakFont
};
use
super
::
UNIFIED_SHADER_HANDLE
;
use
super
::
{
Dpi
,
UNIFIED_SHADER_HANDLE
}
;
use
crate
::{
render
::
ui_pass
::
TransparentUI
,
WindowSize
};
pub
struct
UnifiedPipeline
{
...
...
@@ -542,6 +543,7 @@ pub struct DrawUI {
SRes
<
FontTextureCache
>
,
SRes
<
ImageBindGroups
>
,
SRes
<
WindowSize
>
,
SRes
<
Dpi
>
,
SQuery
<
Read
<
ViewUniformOffset
>>
,
SQuery
<
Read
<
ExtractedQuad
>>
,
)
>
,
...
...
@@ -570,6 +572,7 @@ impl Draw<TransparentUI> for DrawUI {
font_texture_cache
,
image_bind_groups
,
window_size
,
dpi
,
views
,
quads
,
)
=
self
.params
.get
(
world
);
...
...
@@ -579,6 +582,7 @@ impl Draw<TransparentUI> for DrawUI {
let
extracted_quad
=
quads
.get
(
item
.entity
)
.unwrap
();
if
extracted_quad
.quad_type
==
UIQuadType
::
Clip
{
let
window_size
=
(
window_size
.0
*
dpi
.0
,
window_size
.1
*
dpi
.0
);
let
x
=
extracted_quad
.rect.min.x
as
u32
;
let
y
=
extracted_quad
.rect.min.y
as
u32
;
let
mut
width
=
extracted_quad
.rect
.width
()
as
u32
;
...
...
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