mirror of
https://github.com/lightsoutgames/godot-tts
synced 2024-11-22 17:55:57 +00:00
#2: Cast rate setter value and u8::MAX
to f32
to prevent overflow/padding.
This commit is contained in:
parent
8fc2321050
commit
ec99d318d3
|
@ -35,7 +35,8 @@ impl NativeClass for TTS {
|
||||||
if v > 100 {
|
if v > 100 {
|
||||||
v = 100;
|
v = 100;
|
||||||
}
|
}
|
||||||
let v = v / 100 * u8::MAX;
|
let mut v = v as f32;
|
||||||
|
v = v * u8::MAX as f32 / 100.;
|
||||||
this.0.set_rate(v as u8).unwrap();
|
this.0.set_rate(v as u8).unwrap();
|
||||||
},
|
},
|
||||||
usage: PropertyUsage::DEFAULT,
|
usage: PropertyUsage::DEFAULT,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user