DanielGavin / ols

Language server for Odin
MIT License
382 stars 58 forks source link

This code causes ols to crash #296

Closed sackboy19 closed 5 months ago

sackboy19 commented 6 months ago
package main
import "core:fmt"
import "core:math"

Animation :: struct {
    t, time_clicked, click_t: f32,
    is_click_animating:   bool,
    is_click_deanimating: bool,
    is_holding: bool,
}
animation_table := make(map[ID]^Animation, 32)

AnimatedButton :: proc(label: cstring, start_col: Vec4, hover_col: Vec4, click_col: Vec4, rounding: f32 = 12.0, padding: Vec2 = {20.0, 20.0}, size: Vec2 = {0.0, 0.0}) -> bool {
    elem := animation_table[id]
    none_color := math.lerp(start_col, hover_col, ease_out_cubic(elem.t))
    return ret
}

This code crashes my ols every time

DanielGavin commented 6 months ago

It doesn't crash on the new poly branch. I'll keep it open until it's merged to master.