mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-20 23:52:40 +08:00
fix java IllegalArgumentException (#1570)
* fix java IllegalArgumentException * Remove multiple parameter checks
This commit is contained in:
@@ -110,6 +110,12 @@ public:
|
||||
{
|
||||
if (_bufferWidth < 1.0f || _bufferHeight < 1.0f)
|
||||
return;
|
||||
if (x >= _bufferWidth || y >= _bufferHeight)
|
||||
return;
|
||||
if (x + w > _bufferWidth)
|
||||
w = _bufferWidth - x;
|
||||
if (y + h > _bufferHeight)
|
||||
h = _bufferHeight - y;
|
||||
JniHelper::callObjectVoidMethod(_obj, JCLS_CANVASIMPL, "clearRect", x, y, w, h);
|
||||
fillData();
|
||||
}
|
||||
@@ -118,6 +124,12 @@ public:
|
||||
{
|
||||
if (_bufferWidth < 1.0f || _bufferHeight < 1.0f)
|
||||
return;
|
||||
if (x >= _bufferWidth || y >= _bufferHeight)
|
||||
return;
|
||||
if (x + w > _bufferWidth)
|
||||
w = _bufferWidth - x;
|
||||
if (y + h > _bufferHeight)
|
||||
h = _bufferHeight - y;
|
||||
JniHelper::callObjectVoidMethod(_obj, JCLS_CANVASIMPL, "fillRect", x, y, w, h);
|
||||
fillData();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user