Skip to content

Commit dffde21

Browse files
committed
[[ EmscriptenWindows ]] Need to redraw entire stack when canvas is resized
1 parent 957ead7 commit dffde21

File tree

8 files changed

+36
-1
lines changed

8 files changed

+36
-1
lines changed

engine/src/desktop-stack.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,11 @@ MCRectangle MCStack::view_platform_getwindowrect() const
230230
return t_rect;
231231
}
232232

233+
bool MCStack::view_platform_dirtyviewonresize() const
234+
{
235+
return false;
236+
}
237+
233238
// IM-2013-09-23: [[ FullscreenMode ]] Factor out device-specific window sizing
234239
MCRectangle MCStack::view_platform_setgeom(const MCRectangle &p_rect)
235240
{

engine/src/em-stack.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ MCStack::release_window_buffer()
109109
* View management
110110
* ================================================================ */
111111

112+
bool MCStack::view_platform_dirtyviewonresize() const
113+
{
114+
return true;
115+
}
116+
112117
void
113118
MCStack::view_platform_updatewindow(MCRegionRef p_dirty_region)
114119
{

engine/src/lnxstack.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,11 @@ void MCStack::destroywindowshape()
463463
m_window_shape = nil;
464464
}
465465

466+
bool MCStack::view_platform_dirtyviewonresize() const
467+
{
468+
return false;
469+
}
470+
466471
// IM-2014-01-29: [[ HiDPI ]] Placeholder method for Linux HiDPI support
467472
MCRectangle MCStack::view_platform_getwindowrect(void) const
468473
{

engine/src/mblstack.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,11 @@ void MCStack::updatedocumentfilename(void)
165165

166166
////////////////////////////////////////////////////////////////////////////////
167167

168+
bool MCStack::view_platform_dirtyviewonresize() const
169+
{
170+
return false;
171+
}
172+
168173
MCRectangle MCStack::view_platform_getwindowrect() const
169174
{
170175
return view_getrect();

engine/src/srvstack.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,11 @@ void MCStack::destroywindowshape(void)
121121
{
122122
}
123123

124+
bool MCStack::view_platform_dirtyviewonresize() const
125+
{
126+
return false;
127+
}
128+
124129
MCRectangle MCStack::view_platform_setgeom(const MCRectangle &p_rect)
125130
{
126131
return MCRectangleMake(0,0,0,0);

engine/src/stack.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,11 @@ class MCStack : public MCObject, public MCMixinObjectHandle<MCStack>
417417
// IM-2014-01-24: [[ HiDPI ]] The request region is specified in logical coordinates.
418418
void view_platform_updatewindowwithcallback(MCRegionRef p_region, MCStackUpdateCallback p_callback, void *p_context);
419419

420+
// Some platforms require the entire window to be redrawn when resized.
421+
// This method indicates whether or not to mark the entire view as dirty
422+
// when resized.
423+
bool view_platform_dirtyviewonresize() const;
424+
420425
//////////
421426

422427
// MW-2011-09-10: [[ Redraw ]] Perform a redraw of the window's content to the given surface.

engine/src/stackview.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ void MCStack::view_on_rect_changed(void)
323323
// IM-2013-10-03: [[ FullscreenMode ]] if the view rect has changed, update the tilecache geometry
324324
view_updatetilecacheviewport();
325325

326-
if (view_getfullscreen())
326+
if (view_getfullscreen() || view_platform_dirtyviewonresize())
327327
view_dirty_all();
328328
}
329329

engine/src/w32stack.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,11 @@ void MCStack::sethints()
474474
SetWindowLongA((HWND)window->handle.window, 0, (LONG)sptr->getw()->handle.window);
475475
}
476476

477+
bool MCStack::view_platform_dirtyviewonresize()
478+
{
479+
return false;
480+
}
481+
477482
MCRectangle MCStack::view_platform_getwindowrect() const
478483
{
479484
if (window == DNULL)

0 commit comments

Comments
 (0)