mirror of
https://github.com/aseprite/aseprite.git
synced 2025-02-06 03:39:51 +00:00
Fix color problems with overlays (fix #1914)
There were two problems: 1) Overlays weren't using the screen color space, so restoring the pixels were modifying the original saved area 2) A custom cursor (when "Use native cursors" option were enabled) was using overlays, when we could use a native custom cursor anyway (without overlays)
This commit is contained in:
parent
b36d3b09e2
commit
d32d8bf938
@ -78,8 +78,12 @@ void Overlay::captureOverlappedArea(os::Surface* screen)
|
|||||||
if (!m_surface)
|
if (!m_surface)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!m_overlap)
|
if (!m_overlap) {
|
||||||
m_overlap = os::instance()->createSurface(m_surface->width(), m_surface->height());
|
// Use the same color space for the overlay as in the screen
|
||||||
|
m_overlap = os::instance()->createSurface(m_surface->width(),
|
||||||
|
m_surface->height(),
|
||||||
|
screen->colorSpace());
|
||||||
|
}
|
||||||
|
|
||||||
os::SurfaceLock lock(m_overlap);
|
os::SurfaceLock lock(m_overlap);
|
||||||
screen->blitTo(m_overlap, m_pos.x, m_pos.y, 0, 0,
|
screen->blitTo(m_overlap, m_pos.x, m_pos.y, 0, 0,
|
||||||
|
@ -82,8 +82,7 @@ static bool update_custom_native_cursor(const Cursor* cursor)
|
|||||||
bool result = false;
|
bool result = false;
|
||||||
|
|
||||||
// Check if we can use a custom native mouse in this platform
|
// Check if we can use a custom native mouse in this platform
|
||||||
if (!use_native_mouse_cursor &&
|
if (support_native_custom_cursor &&
|
||||||
support_native_custom_cursor &&
|
|
||||||
mouse_display) {
|
mouse_display) {
|
||||||
if (cursor) {
|
if (cursor) {
|
||||||
result = mouse_display->setNativeMouseCursor(
|
result = mouse_display->setNativeMouseCursor(
|
||||||
@ -167,7 +166,8 @@ static void update_mouse_cursor()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Try to use a custom native cursor if it's possible
|
// Try to use a custom native cursor if it's possible
|
||||||
if (!update_custom_native_cursor(cursor)) {
|
if (nativeCursor == os::kNoCursor &&
|
||||||
|
!update_custom_native_cursor(cursor)) {
|
||||||
// Or an overlay as last resource
|
// Or an overlay as last resource
|
||||||
update_mouse_overlay(cursor);
|
update_mouse_overlay(cursor);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user