Skip to content

Commit 4be6d7a

Browse files
committed
Merge release/1.2.1 back into develop
2 parents d67ef30 + 8c2aad7 commit 4be6d7a

4 files changed

Lines changed: 23 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.2.1] - 2026-03-17
9+
10+
### Fixed
11+
12+
- **Ground selection box** — tightened to match visible symbol bounds instead of oversized PNG frame
13+
- **Rotation-aware hit-testing** — ground elements now respond correctly to click/drag at all orientations (0°, 90°, 180°, 270°) by inverse-rotating the mouse into local frame
14+
- **Element-over-wire selection priority** — two-pass scan in `findElementAtPosition` ensures components always win over overlapping wires
15+
- **Drag-lock contract** — only selected elements can be dragged; `DragElementCommand` skips non-selected elements when renderer is available
16+
- **Eliminated duplicated hit-test logic**`GUIAdapter.findElementAt` now delegates to `CircuitRenderer.findElementAtPosition`
17+
818
## [1.2.0] - 2026-02-20
919

1020
> Post-Alpha P1 milestone — all critical items from the Alpha review resolved.

CITATION.cff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ contributors:
1212
given-names: "Gary"
1313
- family-names: "Branchet"
1414
given-names: "Susan"
15-
version: "1.1.0"
16-
date-released: "2025-01-15"
15+
version: "1.2.1"
16+
date-released: "2026-03-17"
1717
license: "MIT"
1818
repository-code: "https://github.com/qucat/jscircuit"
1919
repository: "https://github.com/qucat/jscircuit"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jscircuit",
3-
"version": "1.2.0",
3+
"version": "1.2.1",
44
"description": "A web-based circuit editor for designing circuits and exporting netlists.",
55
"main": "src/gui/main.js",
66
"scripts": {

src/gui/renderers/GroundRenderer.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,16 @@ export class GroundRenderer extends ImageRenderer {
170170
const localX = dx * Math.cos(rad) - dy * Math.sin(rad);
171171
const localY = dx * Math.sin(rad) + dy * Math.cos(rad);
172172

173-
// In local frame, the image center is at (-SCALED_WIDTH/2, 0).
174-
// Match the visual selection box: from image left to the node.
175-
const pad = 8;
176-
const left = -this.SCALED_WIDTH - pad; // image far-left
177-
const right = pad; // just past the node
173+
// Match the visual selection box exactly.
174+
// drawImage is translated to image center (= -SCALED_WIDTH/2 from node).
175+
// Selection box in image-center frame:
176+
// boxLeft = -(drawWidth * 0.01) - pad ≈ -pad
177+
// boxRight = SCALED_WIDTH/2 + pad
178+
// Convert to node frame by subtracting SCALED_WIDTH/2:
179+
const pad = 4;
180+
const nodeOffset = this.SCALED_WIDTH / 2; // 20 — distance from image center to node
181+
const left = -(this.SCALED_WIDTH * 0.01) - pad - nodeOffset; // ≈ -24
182+
const right = pad; // node + pad
178183
const top = -(this.SCALED_HEIGHT / 2) - pad;
179184
const bottom = (this.SCALED_HEIGHT / 2) + pad;
180185

0 commit comments

Comments
 (0)