fix floating window example (#392)
This commit is contained in:
parent
ac19d7e08a
commit
bb68d06440
@ -356,7 +356,8 @@ EXAMPLES = \
|
||||
scroll_panel/scroll_panel \
|
||||
style_selector/style_selector \
|
||||
custom_sliders/custom_sliders \
|
||||
animation_curve/animation_curve
|
||||
animation_curve/animation_curve \
|
||||
floating_window/floating_window \
|
||||
|
||||
CURRENT_MAKEFILE = $(lastword $(MAKEFILE_LIST))
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "raylib.h"
|
||||
|
||||
#define RAYGUI_IMPLEMENTATION
|
||||
#include "../../raygui.h"
|
||||
#include "../../src/raygui.h"
|
||||
|
||||
#include "../../styles/dark/style_dark.h"
|
||||
|
||||
@ -61,9 +61,11 @@ void GuiWindowFloating(Vector2 *position, Vector2 *size, bool *minimized, bool *
|
||||
}
|
||||
|
||||
} else if(*resizing) {
|
||||
Vector2 mouse_delta = GetMouseDelta();
|
||||
size->x += mouse_delta.x;
|
||||
size->y += mouse_delta.y;
|
||||
Vector2 mouse = GetMousePosition();
|
||||
if (mouse.x > position->x)
|
||||
size->x = mouse.x - position->x;
|
||||
if (mouse.y > position->y)
|
||||
size->y = mouse.y - position->y;
|
||||
|
||||
// clamp window size to an arbitrary minimum value and the window size as the maximum
|
||||
if(size->x < 100) size->x = 100;
|
||||
|
Loading…
x
Reference in New Issue
Block a user