Fix wrong cursor on line numbers and scroll
This commit is contained in:
@@ -257,20 +257,21 @@ bool GlobalCommand(Event event) {
|
|||||||
ProfileFunction();
|
ProfileFunction();
|
||||||
bool run_window_command = true;
|
bool run_window_command = true;
|
||||||
{
|
{
|
||||||
Vec2I mouse = MouseVec2I();
|
Vec2I mouse = MouseVec2I();
|
||||||
Window *window = GetActiveWindow();
|
Window *window = GetActiveWindow();
|
||||||
bool mouse_in_document = CheckCollisionPointRec(mouse, window->document_rect);
|
bool mouse_in_document = CheckCollisionPointRec(mouse, window->document_rect);
|
||||||
bool mouse_in_total = CheckCollisionPointRec(mouse, window->total_rect);
|
bool mouse_in_total = CheckCollisionPointRec(mouse, window->total_rect);
|
||||||
bool mouse_in_scrollbar = CheckCollisionPointRec(mouse, window->scrollbar_rect);
|
bool mouse_in_line_numbers = CheckCollisionPointRec(mouse, window->line_numbers_rect);
|
||||||
window->mouse_in_scrollbar = mouse_in_scrollbar;
|
bool mouse_in_scrollbar = CheckCollisionPointRec(mouse, window->scrollbar_rect);
|
||||||
|
window->mouse_in_scrollbar = mouse_in_scrollbar;
|
||||||
|
|
||||||
static SDL_Cursor *SDL_MouseCursor;
|
static SDL_Cursor *SDL_MouseCursor;
|
||||||
if (SDL_MouseCursor) SDL_DestroyCursor(SDL_MouseCursor);
|
if (SDL_MouseCursor) SDL_DestroyCursor(SDL_MouseCursor);
|
||||||
|
|
||||||
if (window->mouse_selecting || mouse_in_total) {
|
if (window->mouse_selecting || mouse_in_document) {
|
||||||
SDL_MouseCursor = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_TEXT);
|
SDL_MouseCursor = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_TEXT);
|
||||||
SDL_SetCursor(SDL_MouseCursor);
|
SDL_SetCursor(SDL_MouseCursor);
|
||||||
} else if (mouse_in_scrollbar || window->mouse_selecting_scrollbar) {
|
} else if (mouse_in_scrollbar || window->mouse_selecting_scrollbar || mouse_in_line_numbers) {
|
||||||
SDL_MouseCursor = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_DEFAULT);
|
SDL_MouseCursor = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_DEFAULT);
|
||||||
SDL_SetCursor(SDL_MouseCursor);
|
SDL_SetCursor(SDL_MouseCursor);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -319,7 +319,6 @@ int main()
|
|||||||
|
|
||||||
// This is here to render changes in title bar size without a frame of delay
|
// This is here to render changes in title bar size without a frame of delay
|
||||||
LayoutWindows();
|
LayoutWindows();
|
||||||
|
|
||||||
BeginFrameRender();
|
BeginFrameRender();
|
||||||
Scratch scratch;
|
Scratch scratch;
|
||||||
Array<Int> order = GetWindowZOrder(scratch);
|
Array<Int> order = GetWindowZOrder(scratch);
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
- bugs:
|
- bugs:
|
||||||
- scrolling in fullscreen is busted because no space outside of window
|
|
||||||
- scrolling when clicking on scroller is busted
|
|
||||||
- page up and down should also scroll and leave you in exactly same scroll
|
- page up and down should also scroll and leave you in exactly same scroll
|
||||||
- I think the way sublime text and we display line highlights is confusing with multiple cursors (line highlight can be confused with selection)
|
- I think the way sublime text and we display line highlights is confusing with multiple cursors (line highlight can be confused with selection)
|
||||||
- don't trim lines with cursor or selection on it
|
- don't trim lines with cursor or selection on it
|
||||||
|
|||||||
Reference in New Issue
Block a user