mirror of
https://github.com/aseprite/aseprite.git
synced 2025-02-20 18:40:57 +00:00
Fix regression: 'Simple Crosshair' mouse cursor dissapears when we switch to Eraser tool
Regression introduced in: ef4f691459d13b45459c56383ab3673ca6fbec0a
This commit is contained in:
parent
4fe8c93c5c
commit
ca41785f18
@ -469,7 +469,11 @@ void BrushPreview::createNativeCursor()
|
||||
|
||||
if (cursorBounds.isEmpty()) {
|
||||
ASSERT(!m_cursor);
|
||||
m_editor->manager()->getDisplay()->setNativeMouseCursor(os::NativeCursor::kNoCursor);
|
||||
if (!(m_type & NATIVE_CROSSHAIR)) {
|
||||
// TODO should we use ui::set_mouse_cursor()?
|
||||
ui::set_mouse_cursor_reset_info();
|
||||
m_editor->manager()->getDisplay()->setNativeMouseCursor(os::NativeCursor::kNoCursor);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@ -508,6 +512,10 @@ void BrushPreview::forEachLittleCrossPixel(
|
||||
}
|
||||
|
||||
if (m_cursor) {
|
||||
ASSERT(m_cursor);
|
||||
|
||||
// TODO should we use ui::set_mouse_cursor()?
|
||||
ui::set_mouse_cursor_reset_info();
|
||||
m_editor->manager()->getDisplay()->setNativeMouseCursor(
|
||||
m_cursor, m_cursorCenter,
|
||||
m_editor->manager()->getDisplay()->scale());
|
||||
|
@ -2680,10 +2680,6 @@ void Editor::showMouseCursor(CursorType cursorType,
|
||||
|
||||
void Editor::showBrushPreview(const gfx::Point& screenPos)
|
||||
{
|
||||
if (Preferences::instance().cursor.paintingCursorType() !=
|
||||
app::gen::PaintingCursorType::SIMPLE_CROSSHAIR)
|
||||
ui::set_mouse_cursor(kNoCursor);
|
||||
|
||||
m_brushPreview.show(screenPos);
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite UI Library
|
||||
// Copyright (C) 2018-2020 Igara Studio S.A.
|
||||
// Copyright (C) 2018-2021 Igara Studio S.A.
|
||||
// Copyright (C) 2001-2018 David Capello
|
||||
//
|
||||
// This file is released under the terms of the MIT license.
|
||||
@ -299,6 +299,12 @@ void set_mouse_cursor_scale(const int newScale)
|
||||
update_mouse_cursor();
|
||||
}
|
||||
|
||||
void set_mouse_cursor_reset_info()
|
||||
{
|
||||
mouse_cursor_type = kCustomCursor;
|
||||
mouse_cursor_custom = nullptr;
|
||||
}
|
||||
|
||||
void hide_mouse_cursor()
|
||||
{
|
||||
ASSERT(mouse_scares >= 0);
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite UI Library
|
||||
// Copyright (C) 2019-2020 Igara Studio S.A.
|
||||
// Copyright (C) 2019-2021 Igara Studio S.A.
|
||||
// Copyright (C) 2001-2018 David Capello
|
||||
//
|
||||
// This file is released under the terms of the MIT license.
|
||||
@ -57,6 +57,7 @@ namespace ui {
|
||||
CursorType get_mouse_cursor();
|
||||
void set_mouse_cursor(CursorType type, const Cursor* cursor = nullptr);
|
||||
void set_mouse_cursor_scale(const int newScale);
|
||||
void set_mouse_cursor_reset_info();
|
||||
|
||||
void hide_mouse_cursor();
|
||||
void show_mouse_cursor();
|
||||
|
Loading…
x
Reference in New Issue
Block a user