This is the source for RepaintRect...
STDMETHODIMP FbWindow::RepaintRect(UINT x, UINT y, UINT w, UINT h, VARIANT_BOOL force)
{
TRACK_FUNCTION();
m_host->RepaintRect(x, y, w, h, force != FALSE);
return S_OK;
}
According to a quick google, UINT should be a positive integer so I don't know why using -1 doesn't throw errors all the time??
EDIT: I just added this inside the function...
console::formatter() << y;
and it spits out this when you feed it -1.
4294967295
That just happens to the maximum possible value for UINT. So even though it's not crashing, it's not repainting the area you want it to either!!
With JScript9 engine, the console code doesn't even get to run. I get an overflow error before it happens. Presumably there is some difference with how the scripting engine handles these numbers??
EDIT2: I've updated the docs...
window.RepaintRect(x, y, w, h[, force]);
// x, y, w, h must be an integer, 0 or above. if you cannot be sure of values when
// calculating, do something like this...
// window.RepaintRect(Math.max(0, x), Math.max(0, y), w, h);
// force: boolean, default false
// use this instead of Repaint on frequently updated areas
// such as time, bitrate, seekbar, etc. this should reduce CPU usage.
// you can use Windows Task Manager to double check.