Skip to content

Commit d4069fb

Browse files
authored
Merge branch 'master' into winit-0.31
2 parents 986ab12 + c450689 commit d4069fb

14 files changed

Lines changed: 152 additions & 128 deletions

File tree

Cargo.lock

Lines changed: 109 additions & 81 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flatpak/cargo-config.toml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
11
[source.crates-io]
22
replace-with = "vendored-sources"
33

4-
[source."git+https://github.com/iced-rs/cryoglyph.git?rev=be2defe4a13fd7c97c6f4c81e8e085463eb578dc"]
5-
git = "https://github.com/iced-rs/cryoglyph.git"
6-
rev = "be2defe4a13fd7c97c6f4c81e8e085463eb578dc"
7-
replace-with = "vendored-sources"
8-
9-
[source."git+https://github.com/iced-rs/iced.git?rev=892ac1ce722a809e73aecd8d47ed4e7254d156df"]
10-
git = "https://github.com/iced-rs/iced.git"
11-
rev = "892ac1ce722a809e73aecd8d47ed4e7254d156df"
12-
replace-with = "vendored-sources"
13-
144
[source.vendored-sources]
155
directory = "vendor"

flatpak/com.github.polymeilex.neothesia.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"app-id": "com.github.polymeilex.neothesia",
33
"runtime": "org.freedesktop.Platform",
4-
"runtime-version": "24.08",
4+
"runtime-version": "25.08",
55
"sdk": "org.freedesktop.Sdk",
66
"sdk-extensions": ["org.freedesktop.Sdk.Extension.rust-stable"],
77
"command": "neothesia",
@@ -37,13 +37,13 @@
3737
{
3838
"type": "git",
3939
"url": "https://github.com/PolyMeilex/Neothesia.git",
40-
"tag": "v0.3.0",
40+
"tag": "v0.4.0",
4141
"commit": "..."
4242
},
4343
{
4444
"type": "archive",
45-
"url": "https://github.com/flathub/com.github.polymeilex.neothesia/releases/download/0.2.0-vendor/vendor.tar.xz",
46-
"sha256": "bdb3ed37cf2174f7122a6d10d87fac4f5eef649264f7beda0e6a88288f7f6ffb",
45+
"url": "https://github.com/flathub/com.github.polymeilex.neothesia/releases/download/0.4.0-vendor/vendor.tar.xz",
46+
"sha256": "...",
4747
"dest": "vendor"
4848
}
4949
]

flatpak/com.github.polymeilex.neothesia.metainfo.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
<project_license>GPL-3.0-only</project_license>
88

99
<releases>
10+
<release version="0.4.0" date="2026-31-01" timestamp="1769877506">
11+
<url>https://github.com/PolyMeilex/Neothesia/releases/tag/v0.4.0</url>
12+
</release>
1013
<release version="0.3.0" date="2025-23-05" timestamp="1747954829">
1114
<url>https://github.com/PolyMeilex/Neothesia/releases/tag/v0.3.0</url>
1215
</release>

midi-io/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ edition.workspace = true
55

66
[dependencies]
77
midir.workspace = true
8+
log.workspace = true

midi-io/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ impl MidiInputManager {
100100
},
101101
(),
102102
)
103+
.inspect_err(|err| log::error!("MIDI-in connection fail: {err}"))
103104
.ok()
104105
})
105106
.map(MidiInputConnection)

neothesia-core/src/render/keyboard/mod.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,13 @@ impl KeyboardRenderer {
9696
fn rebuild_quad_cache(&mut self) {
9797
let instances = &mut self.cache;
9898

99+
instances.push(QuadInstance {
100+
position: [self.pos.x, self.pos.y - 4.0],
101+
size: [self.layout.width, 4.0],
102+
color: [0.25, 0.02, 0.02, 1.0],
103+
..Default::default()
104+
});
105+
99106
// black_background
100107
instances.push(QuadInstance {
101108
position: self.pos.into(),

neothesia-core/src/render/quad/shader.wgsl

Lines changed: 13 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -57,22 +57,13 @@ fn vs_main(vertex: Vertex, quad: QuadInstance) -> VertexOutput {
5757
return out;
5858
}
5959

60-
// SFD code is licenced under: MIT by Héctor Ramón & Iced contributors
61-
fn distance_alg(
62-
frag_coord: vec2<f32>,
63-
position: vec2<f32>,
64-
size: vec2<f32>,
65-
radius: f32
66-
) -> f32 {
67-
var inner_half_size: vec2<f32> = (size - vec2<f32>(radius, radius) * 2.0) / 2.0;
68-
var top_left: vec2<f32> = position + vec2<f32>(radius, radius);
69-
return rounded_box_sdf(frag_coord - top_left - inner_half_size, inner_half_size, 0.0);
70-
}
71-
72-
// Given a vector from a point to the center of a rounded rectangle of the given `size` and
73-
// border `radius`, determines the point's distance from the nearest edge of the rounded rectangle
60+
// Point's distance from the nearest edge of the rounded rectangle
61+
//
62+
// https://www.shadertoy.com/view/Nlc3zf
7463
fn rounded_box_sdf(to_center: vec2<f32>, size: vec2<f32>, radius: f32) -> f32 {
75-
return length(max(abs(to_center) - size + vec2<f32>(radius, radius), vec2<f32>(0.0, 0.0))) - radius;
64+
let half_size = size * 0.5;
65+
let q = abs(to_center) - half_size + vec2(radius, radius);
66+
return length(max(q, vec2(0.0))) + min(max(q.x, q.y), 0.0) - radius;
7667
}
7768

7869
// Based on the fragment position and the center of the quad, select one of the 4 radii.
@@ -89,24 +80,17 @@ fn select_border_radius(radii: vec4<f32>, position: vec2<f32>, center: vec2<f32>
8980

9081
@fragment
9182
fn fs_main(in: VertexOutput) -> @location(0) vec4<f32> {
92-
var border_radius = select_border_radius(
83+
let center = in.quad_position + in.quad_size * 0.5;
84+
85+
let border_radius = select_border_radius(
9386
in.quad_border_radius,
9487
in.position.xy,
95-
(in.quad_position + (in.quad_size * 0.5)).xy
88+
center
9689
);
9790

98-
var dist: f32 = distance_alg(
99-
vec2<f32>(in.position.x, in.position.y),
100-
in.quad_position,
101-
in.quad_size,
102-
border_radius
103-
);
104-
105-
var alpha: f32 = 1.0 - smoothstep(
106-
max(border_radius - 0.5, 0.0),
107-
border_radius + 0.5,
108-
dist
109-
);
91+
let local_center = in.position.xy - center;
92+
let dist = rounded_box_sdf(local_center, in.quad_size, border_radius);
93+
let alpha = 1.0 - smoothstep(-0.5, 0.5, dist);
11094

11195
return vec4(in.quad_color.xyz, in.quad_color.w * alpha);
11296
}

neothesia/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "neothesia"
3-
version = "0.3.0"
3+
version = "0.4.0"
44
authors = ["Poly <marynczak.bartlomiej@gmail.com>"]
55
edition.workspace = true
66
default-run = "neothesia"

neothesia/src/icons.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(unused)]
2+
13
pub fn cone_icon() -> &'static str {
24
"\u{F2D2}"
35
}
@@ -34,7 +36,6 @@ pub fn plus_icon() -> &'static str {
3436
"\u{F4FE}"
3537
}
3638

37-
#[allow(unused)]
3839
pub fn balloon_icon() -> &'static str {
3940
"\u{f709}"
4041
}

0 commit comments

Comments
 (0)