Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions src/types/devices/device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,19 +208,19 @@ export class Device extends Sprite {
// Create the square as a selection marker
this.highlightMarker = new Graphics();

// Increase the square size
const size = this.width; // Side length of the square, now larger

// Draw a square using moveTo and lineTo
this.highlightMarker.moveTo(-size / 2, -size / 2); // Move to the top left corner of the centered square
this.highlightMarker.lineTo(size / 2, -size / 2); // Top line
this.highlightMarker.lineTo(size / 2, size / 2); // Right line
this.highlightMarker.lineTo(-size / 2, size / 2); // Bottom line
this.highlightMarker.lineTo(-size / 2, -size / 2); // Left line, closes the square

// Change color to red and increase line thickness
this.highlightMarker.stroke({ width: 3, color: Colors.Violet }); // Red and thicker

this.highlightMarker.roundRect(
-this.width / 2,
-this.height / 2,
this.width,
this.height,
5,
);
this.highlightMarker.stroke({
width: 3,
color: Colors.Violet,
alpha: 0.6,
});
this.highlightMarker.fill({ color: Colors.Violet, alpha: 0.1 });
this.highlightMarker.zIndex = ZIndexLevels.Device;

// Ensure the marker is in the same container as the viewport
Expand Down
1 change: 1 addition & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export enum Colors {
Red = 0xff0000,
White = 0xffffff,
Black = 0x000000,
Yellow = 0xffff00,
}

export function circleGraphicsContext(
Expand Down