mirror of
https://github.com/tobspr/shapez.io.git
synced 2026-03-02 03:39:21 +00:00
Improve performance by getting rid of instanceof
This commit is contained in:
@@ -144,9 +144,9 @@ export class AtlasSprite extends BaseSprite {
|
||||
*/
|
||||
drawCached(parameters, x, y, w = null, h = null, clipping = true) {
|
||||
if (G_IS_DEV) {
|
||||
assertAlways(parameters instanceof DrawParameters, "Not a valid context");
|
||||
assertAlways(!!w && w > 0, "Not a valid width:" + w);
|
||||
assertAlways(!!h && h > 0, "Not a valid height:" + h);
|
||||
assert(parameters instanceof DrawParameters, "Not a valid context");
|
||||
assert(!!w && w > 0, "Not a valid width:" + w);
|
||||
assert(!!h && h > 0, "Not a valid height:" + h);
|
||||
}
|
||||
|
||||
const visibleRect = parameters.visibleRect;
|
||||
|
||||
Reference in New Issue
Block a user