mirror of
https://github.com/aseprite/aseprite.git
synced 2025-04-09 18:44:46 +00:00
Fix crash resizing the window when we restart the app on OS X and it was closed on fullscreen size
This commit is contained in:
parent
6e15553c88
commit
caf8388ac6
@ -384,46 +384,62 @@ void osx_update_dirty_lines(void)
|
|||||||
|
|
||||||
qd_view_port = [qd_view qdPort];
|
qd_view_port = [qd_view qdPort];
|
||||||
if (qd_view_port) {
|
if (qd_view_port) {
|
||||||
qd_view_pitch = GetPixRowBytes(GetPortPixMap(qd_view_port));
|
Rect qd_view_bounds;
|
||||||
qd_view_addr = GetPixBaseAddr(GetPortPixMap(qd_view_port)) +
|
int qd_view_width;
|
||||||
((int)([osx_window frame].size.height) - gfx_quartz_window.h) * qd_view_pitch;
|
int qd_view_height;
|
||||||
|
|
||||||
if (colorconv_blitter || (osx_setup_colorconv_blitter() == 0)) {
|
GetPortBounds(qd_view_port, &qd_view_bounds);
|
||||||
SetEmptyRgn(update_region);
|
qd_view_width = (qd_view_bounds.right - qd_view_bounds.left);
|
||||||
|
qd_view_height = (qd_view_bounds.bottom - qd_view_bounds.top);
|
||||||
|
|
||||||
rect.left = 0;
|
ASSERT(qd_view_width > 0);
|
||||||
rect.right = gfx_quartz_window.w;
|
ASSERT(qd_view_height > 0);
|
||||||
|
|
||||||
while (rect.top < gfx_quartz_window.h) {
|
if (qd_view_width > 0 && qd_view_height > 0) {
|
||||||
while ((!dirty_lines[rect.top]) && (rect.top < gfx_quartz_window.h))
|
int titlebar_height =
|
||||||
rect.top++;
|
((int)([osx_window frame].size.height) - gfx_quartz_window.h);
|
||||||
if (rect.top >= gfx_quartz_window.h)
|
|
||||||
break;
|
qd_view_pitch = GetPixRowBytes(GetPortPixMap(qd_view_port));
|
||||||
rect.bottom = rect.top;
|
qd_view_addr = GetPixBaseAddr(GetPortPixMap(qd_view_port)) +
|
||||||
while ((dirty_lines[rect.bottom]) && (rect.bottom < gfx_quartz_window.h)) {
|
titlebar_height * qd_view_pitch;
|
||||||
dirty_lines[rect.bottom] = 0;
|
|
||||||
rect.bottom++;
|
if (colorconv_blitter || (osx_setup_colorconv_blitter() == 0)) {
|
||||||
|
SetEmptyRgn(update_region);
|
||||||
|
|
||||||
|
rect.left = 0;
|
||||||
|
rect.right = qd_view_width;
|
||||||
|
|
||||||
|
while (rect.top < qd_view_height) {
|
||||||
|
while ((!dirty_lines[rect.top]) && (rect.top < qd_view_height))
|
||||||
|
rect.top++;
|
||||||
|
if (rect.top >= qd_view_height)
|
||||||
|
break;
|
||||||
|
rect.bottom = rect.top;
|
||||||
|
while ((dirty_lines[rect.bottom]) && (rect.bottom < qd_view_height)) {
|
||||||
|
dirty_lines[rect.bottom] = 0;
|
||||||
|
rect.bottom++;
|
||||||
|
}
|
||||||
|
/* fill in source graphics rectangle description */
|
||||||
|
src_gfx_rect.width = rect.right - rect.left;
|
||||||
|
src_gfx_rect.height = rect.bottom - rect.top;
|
||||||
|
src_gfx_rect.pitch = pseudo_screen_pitch;
|
||||||
|
src_gfx_rect.data = pseudo_screen_addr +
|
||||||
|
(rect.top * pseudo_screen_pitch) +
|
||||||
|
(rect.left * BYTES_PER_PIXEL(pseudo_screen_depth));
|
||||||
|
|
||||||
|
/* fill in destination graphics rectangle description */
|
||||||
|
dest_gfx_rect.pitch = qd_view_pitch;
|
||||||
|
dest_gfx_rect.data = qd_view_addr +
|
||||||
|
(rect.top * qd_view_pitch) +
|
||||||
|
(rect.left * BYTES_PER_PIXEL(desktop_depth));
|
||||||
|
|
||||||
|
/* function doing the hard work */
|
||||||
|
colorconv_blitter(&src_gfx_rect, &dest_gfx_rect);
|
||||||
|
|
||||||
|
RectRgn(temp_region, &rect);
|
||||||
|
UnionRgn(temp_region, update_region, update_region);
|
||||||
|
rect.top = rect.bottom;
|
||||||
}
|
}
|
||||||
/* fill in source graphics rectangle description */
|
|
||||||
src_gfx_rect.width = rect.right - rect.left;
|
|
||||||
src_gfx_rect.height = rect.bottom - rect.top;
|
|
||||||
src_gfx_rect.pitch = pseudo_screen_pitch;
|
|
||||||
src_gfx_rect.data = pseudo_screen_addr +
|
|
||||||
(rect.top * pseudo_screen_pitch) +
|
|
||||||
(rect.left * BYTES_PER_PIXEL(pseudo_screen_depth));
|
|
||||||
|
|
||||||
/* fill in destination graphics rectangle description */
|
|
||||||
dest_gfx_rect.pitch = qd_view_pitch;
|
|
||||||
dest_gfx_rect.data = qd_view_addr +
|
|
||||||
(rect.top * qd_view_pitch) +
|
|
||||||
(rect.left * BYTES_PER_PIXEL(desktop_depth));
|
|
||||||
|
|
||||||
/* function doing the hard work */
|
|
||||||
colorconv_blitter(&src_gfx_rect, &dest_gfx_rect);
|
|
||||||
|
|
||||||
RectRgn(temp_region, &rect);
|
|
||||||
UnionRgn(temp_region, update_region, update_region);
|
|
||||||
rect.top = rect.bottom;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
QDFlushPortBuffer(qd_view_port, update_region);
|
QDFlushPortBuffer(qd_view_port, update_region);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user