From 3e1fdb19b8fe484ee307e137bb9ac0710aca43ca Mon Sep 17 00:00:00 2001 From: Erik Onarheim Date: Mon, 29 Jul 2024 14:59:53 -0500 Subject: [PATCH] fix: RasterOptions now extends GraphicsOptions --- CHANGELOG.md | 1 + src/engine/Graphics/Raster.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e270a1e39..5a736416f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -70,6 +70,7 @@ are doing mtv adjustments during precollision. ### Fixed +- Fixed `ex.RasterOptions`, it now extends `ex.GraphicsOptions` which is the underlying truth - Fixed issue where rayCast `filter` would not be called in hit order - Fixed issue where rayCasts would return inconsistent orderings with the `ex.SparseHashGridCollisionProcessor` strategy - Fixed issue where CircleCollider tangent raycast did not work correctly diff --git a/src/engine/Graphics/Raster.ts b/src/engine/Graphics/Raster.ts index 7ee1d3c25..10e53fd0f 100644 --- a/src/engine/Graphics/Raster.ts +++ b/src/engine/Graphics/Raster.ts @@ -7,7 +7,7 @@ import { watch } from '../Util/Watch'; import { ImageFiltering } from './Filtering'; import { omit } from '../Util/Util'; -export interface RasterOptions { +export interface RasterOptions extends GraphicOptions { /** * Optionally specify a quality number, which is how much to scale the internal Raster. Default is 1. * @@ -75,7 +75,7 @@ export abstract class Raster extends Graphic { protected _ctx: CanvasRenderingContext2D; private _dirty: boolean = true; - constructor(options?: GraphicOptions & RasterOptions) { + constructor(options?: RasterOptions) { super(omit({ ...options }, ['width', 'height'])); // rasters do some special sauce with width/height if (options) { this.quality = options.quality ?? this.quality;