mirror of
https://github.com/lightsoutgames/godot-tts
synced 2024-12-22 06:45:56 +00:00
If rate values > 100 are passed in, cap them at 100.
This commit is contained in:
parent
1bb0f56f40
commit
c9c2f182cd
|
@ -31,7 +31,10 @@ impl NativeClass for TTS {
|
|||
let rate = this.0.get_rate().unwrap();
|
||||
rate / u8::MAX * 100
|
||||
},
|
||||
setter: |this: &mut TTS, v: u8| {
|
||||
setter: |this: &mut TTS, mut v: u8| {
|
||||
if v > 100 {
|
||||
v = 100;
|
||||
}
|
||||
let v = v / 100 * u8::MAX;
|
||||
this.0.set_rate(v as u8).unwrap();
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue
Block a user