no mouse zoom
This commit is contained in:
parent
74525e08ac
commit
f07013ad8a
@ -188,7 +188,7 @@ draw_plot :: (key: string, size: Vector2, xdata: []float64, yarrays: [][]float64
|
||||
plot.pos.y += -mouse_delta.y * pixel_size_y / plot.zoom;
|
||||
}
|
||||
|
||||
if !fixed_bounds {
|
||||
if mouse_wheel_zoom && !fixed_bounds {
|
||||
plot.zoom += plot.zoom * (cast(float) mouse_wheel_delta * 0.1);
|
||||
|
||||
if plot.zoom < 0.01 {
|
||||
@ -287,9 +287,10 @@ free_old_plots :: () {
|
||||
}
|
||||
}
|
||||
|
||||
init :: (_win_width: s32, _win_height: s32) {
|
||||
init :: (_win_width: s32, _win_height: s32, _mouse_wheel_zoom : bool) {
|
||||
win_width = _win_width;
|
||||
win_height = _win_height;
|
||||
mouse_wheel_zoom = _mouse_wheel_zoom;
|
||||
|
||||
error := FT_Init_FreeType(*ftlib);
|
||||
if error {
|
||||
@ -351,6 +352,8 @@ primitives_rendered_this_frame : int;
|
||||
win_width : s32;
|
||||
win_height : s32;
|
||||
|
||||
mouse_wheel_zoom : bool;
|
||||
|
||||
PlotColors :: struct {
|
||||
background : Vector3;
|
||||
lines : Vector3;
|
||||
@ -521,6 +524,7 @@ draw_axis :: (using plot: Plot, style: PLOT_STYLE, colors: PlotColors) {
|
||||
array_add(*positions, .{0.0, xx (content_height )});
|
||||
array_add(*positions, .{0.0, 0.0});
|
||||
|
||||
if plot.xfloat.count > 0 {
|
||||
x_ticks := 10;
|
||||
for 0..x_ticks {
|
||||
xpos : s64 = cast(s64) (cast(float) it / cast(float) x_ticks * cast(float) (content_width));
|
||||
@ -557,6 +561,7 @@ draw_axis :: (using plot: Plot, style: PLOT_STYLE, colors: PlotColors) {
|
||||
colors.text, plot.width, plot.height);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
glViewport(xx left_bearing, xx bottom_bearing, xx (width - left_bearing), xx (height - bottom_bearing));
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user