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

excaliburjs / Excalibur / 14804036802

02 May 2025 09:58PM UTC coverage: 5.927% (-83.4%) from 89.28%
14804036802

Pull #3404

github

web-flow
Merge 5c103d7f8 into 0f2ccaeb2
Pull Request #3404: feat: added Graph module to Math

234 of 8383 branches covered (2.79%)

229 of 246 new or added lines in 1 file covered. (93.09%)

13145 existing lines in 208 files now uncovered.

934 of 15759 relevant lines covered (5.93%)

4.72 hits per line

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

0.0
/src/engine/Graphics/Rectangle.ts
1
import { Raster, RasterOptions } from './Raster';
2

3
export interface RectangleOptions {
4
  width: number;
5
  height: number;
6
}
7

8
/**
9
 * A Rectangle {@apilink Graphic} for drawing rectangles to the {@apilink ExcaliburGraphicsContext}
10
 */
11
export class Rectangle extends Raster {
12
  constructor(options: RasterOptions & RectangleOptions) {
UNCOV
13
    super(options);
×
UNCOV
14
    this.width = options.width;
×
UNCOV
15
    this.height = options.height;
×
UNCOV
16
    this.rasterize();
×
17
  }
18

19
  public clone(): Rectangle {
UNCOV
20
    return new Rectangle({
×
21
      width: this.width,
22
      height: this.height,
23
      ...this.cloneGraphicOptions(),
24
      ...this.cloneRasterOptions()
25
    });
26
  }
27

28
  execute(ctx: CanvasRenderingContext2D): void {
UNCOV
29
    if (this.color) {
×
UNCOV
30
      ctx.fillRect(0, 0, this.width, this.height);
×
31
    }
UNCOV
32
    if (this.strokeColor) {
×
UNCOV
33
      ctx.strokeRect(0, 0, this.width, this.height);
×
34
    }
35
  }
36
}
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