• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

excaliburjs / Excalibur / 7295838285

22 Dec 2023 03:21AM UTC coverage: 91.839% (-0.02%) from 91.859%
7295838285

push

github

web-flow
fix: TileMap packing + TileMap debug draw configurable (#2851)

This PR makes TileMap debug draw configurable, and by default reduces the draw burden by toggling off the grid display by default.

This PR also fixes a tilemap packing bug where some situation would result in incorrect colliders


https://github.com/excaliburjs/Excalibur/assets/612071/104bfb9d-c8e3-431e-a454-e8bed89ad960

4625 of 5793 branches covered (0.0%)

51 of 55 new or added lines in 4 files covered. (92.73%)

7 existing lines in 2 files now uncovered.

10702 of 11653 relevant lines covered (91.84%)

27126.35 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

55.56
/src/engine/Configurable.ts
1
export type Constructor<T> = {
2
  new (...args: any[]): T;
3
};
4
/**
5
 * Configurable helper extends base type and makes all properties available as option bag arguments
6
 * @internal
7
 * @param base
8
 */
9
export function Configurable<T extends Constructor<{}>>(base: T): T {
10
  return class extends base {
1✔
11
    public assign(props: Partial<T>) {
12
      //set the value of every property that was passed in,
13
      //if the constructor previously set this value, it will be overridden here
14
      for (const k in props) {
×
15
        // eslint-disable-next-line
16
        if (typeof (<any>this)[k] !== 'function') {
×
17
          // eslint-disable-next-line
18
          (<any>this)[k] = (<any>props)[k];
×
19
        }
20
      }
21
    }
22

23
    constructor(...args: any[]) {
24
      super(...args);
72✔
25
      //get the number of arguments that aren't undefined. TS passes a value to all parameters
26
      //of whatever ctor is the implementation, so args.length doesn't work here.
27
      const size = args.filter(function(value) {
72✔
28
        return value !== undefined;
720✔
29
      }).length;
30
      if (size === 1 && args[0] && typeof args[0] === 'object' && !(args[0] instanceof Array)) {
72!
31
        this.assign(args[0]);
×
32
      }
33
    }
34
  };
35
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc