mirror of
https://github.com/PixelGuys/Cubyz.git
synced 2025-08-04 03:37:59 -04:00
parent
6dc106fb9f
commit
76476faa84
@ -83,7 +83,7 @@ pub fn toComponent(self: *ContinuousSlider) GuiComponent {
|
||||
fn setButtonPosFromValue(self: *ContinuousSlider) void {
|
||||
const range: f32 = self.size[0] - 3*border - self.button.size[0];
|
||||
const len: f32 = self.maxValue - self.minValue;
|
||||
self.button.pos[0] = 1.5*border + range*(0.5 + (self.currentValue - self.minValue))/len;
|
||||
self.button.pos[0] = 1.5*border + range*(self.currentValue - self.minValue)/len;
|
||||
self.updateLabel(self.currentValue, self.size[0]);
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ fn deziBelToLinear(x: f32) f32 {
|
||||
fn linearToDezibel(x: f32) f32 {
|
||||
const db = 20*std.math.log10(x);
|
||||
if(db < -59.95) return -60;
|
||||
return 0;
|
||||
return db;
|
||||
}
|
||||
|
||||
fn musicFormatter(allocator: NeverFailingAllocator, value: f32) []const u8 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user