The 90-degree corners are at x=0 in local coords. The rectangular
region from x=0 to x=min(w2,w) always fits inside the trapezoid.
Text is centered in this safe zone — on the straight-edge side,
not the angled side.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Shift text toward the bottom-right corner of the trapezoid where
the right angle creates the most open space for the label.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Text centered at x = (w2 + w) / 2 — the middle of the wide right
portion of the trapezoid where there's the most space.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Place text centered at the wide bottom edge where there's always
enough room. No font shrinking — the wide end has plenty of space.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Center text at 75% of trapezoid height where the shape is widest,
using the actual width at that height for proper fit.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Center text at vertical midpoint, shifted right toward the wider end
where there's more horizontal space. Uses 55% of the mid-height width
as center position and 85% as available width.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Move text to 65% from top (wider end) so it fits without shrinking
- Fix effective angle for mirrored symbols: use (360-rot) to determine
if flip is needed, preventing incorrect upside-down detection
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Position text at 40% from top (toward narrow end) and constrain width
to the narrower edge so text never overflows the trapezoid shape.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Mirrored symbols need text counter-mirrored (scale -1,1) to prevent
backwards text. Restored mirror fix that was incorrectly removed.
Applied to both canvas renderer and SVG export.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Ignition strips font-weight/font-family/font-size as separate SVG
attributes but preserves them inside style="..." CSS. Moved all text
styling to inline style for conveyance labels and BCN/SOL/PDP symbols.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace dominant-baseline="central" (unsupported in Ignition) with
manual y offset (10 -> 12.8) for proper vertical centering of text
inside these symbol boxes.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Labels now follow the mirrored shape naturally — text mirrors
along with the conveyor/shape as the user expects.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Canvas renderer:
- Straight/spur: flip text 180 when rotation is 91-269 deg
- Mirror: counter-scale text so it doesn't read backwards
- Curved: compute world angle (sym rotation + tangent), flip if upside-down
SVG export:
- Curved text now includes rotation transform along the arc tangent
- Straight text includes rotation correction for readability
- All text stays grouped with its shape for proper transform inheritance
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Wrap each conveyance shape + its label text in a <g> element so
rotation/mirror transforms apply to both shape and text together
- Change stroke-width from 0.5 to 1 on all conveyance and PE shapes
(both canvas renderer and SVG export)
- Text is now inside the group, inheriting the transform — no more
floating unrotated labels
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Toolbar:
- Compact project/MCM selectors always visible at top
- Action bar (SVG, JSON, Import, Clear) as compact button strip
- Cleaner section toggles with minimal chrome
- Inline settings rows (W/H and Grid/Gap on one line each)
- Narrower width (220px vs 240px)
Palette:
- Group headers are collapsible (start collapsed to save space)
- Small symbols (Controls, Sensors, I/O, Other) use 2-column grid
- Conveyance keeps list layout (wider items)
- Lighter, less cluttered item styling
- Custom scrollbar
Color scheme:
- Shifted from navy/red (#16213e/#e94560) to slate/blue (#111827/#3b82f6)
- Better contrast and more professional feel
- DeviceDock updated to match
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- SVG export now embeds layout JSON as HTML comment for re-import
- New loadLayoutSVG() extracts embedded data from exported SVGs
- Import accepts both .json and .svg files
- New exportJSON() saves layout as MCM_layout.json
- JSON export button added to toolbar
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Ignition strips SVG transforms from text elements, causing labels to
float to wrong positions. Now all text uses pre-computed absolute x/y
coordinates without any transform attributes. Also fixes positioning
for curved (at arc midpoint), spur (trapezoid center), and induction
(strip center) symbols.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Curved: position at arc midpoint with rotation along curve
- Spur: center in trapezoid shape, not bounding box
- All: use dy offset instead of dominant-baseline for reliable centering
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Curved: position text at arc band midpoint, rotated along the curve
- Spur: center text in the trapezoid shape, not the bounding box
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
isTypeCompatible now matches by conveyance family, not just SVG file.
Conveyor family includes: conveyor, spur, curved_conv, induction, extendo.
Chute family includes: chute, tipper, curved_chute.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Parse labels like UL17_22_VFD into stacked text: "UL" / "17-22".
Bold black Arial, targets 14px but auto-scales down to fit with
consistent padding. Strips _VFD suffix, splits prefix from numbers.
If full text doesn't fit, strips the letter prefix.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix shift-drag: require 8px movement before locking axis, use strict
greater-than to avoid horizontal bias at small deltas
- Add PE shape-following outline for selection/hover/collision highlights
- Add PE shape-aware hit-testing (arrow + beam + receiver zones with margin)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The axis constraint was recalculated every mouse move, causing the symbol
to jerk between horizontal and vertical near the 45-degree diagonal.
Now the axis locks on first movement and stays locked until shift is released.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Also add previous 30x14 default to migration table so existing
PEs at either old size get updated on load.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Split SVG export into two passes: base conveyance symbols first, then
overlay devices rendered last so they appear on top in the exported SVG.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replaces embedded SVG export (which used non-uniform scale transforms
that stretched strokes) with programmatic path/rect elements matching
the canvas renderer. Consistent 0.5px stroke at any size.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When loading saved state, symbols with known outdated default sizes
(e.g., photoeye 56x20) are migrated to current defaults (30x14).
Only exact matches of old defaults are migrated — user-resized
symbols keep their custom dimensions.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Change all curved conveyor/chute SVGs from black to white fill
- Add CSS filter:invert(1) to palette thumbnails so white-fill symbols
remain visible on the dark palette background
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Cast EPC defaultWaypoints readonly tuple to EpcWaypoint[] in collision.ts
- Fix pdfjs render() call with canvas property
- Remove unused @ts-expect-error directive
- Add @types/node and type annotations for vite.config.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
SVG-based rendering caused non-uniform stroke scaling when symbols were
stretched. Now conveyor, chute, tipper are drawn as canvas rects, and
extendo is drawn as a canvas path with fixed left bracket proportions.
All use consistent 0.5px stroke regardless of size.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Change all conveyance SVGs from black fill to white fill with black stroke
- Update programmatic rendering (curves, induction, spur) to white fill
- Replace PE 3-slice rendering with programmatic canvas paths for
consistent stroke width at any size
- Reduce PE default size from 56x20 to 30x14 to fit around conveyor devices
- Update SVG export to match new white fills
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
End box was 10×20 (tall/narrow perpendicular to line), now 20×10
(wide/squat along line), matching the start icon's landscape proportions.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Rotate the direction vector -90° for the right box in collision
detection and bounds calculation to match the perpendicular
rendering orientation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Right box stroke now uses EPC_CONFIG.lineWidth (1.5) instead of 0.3
- Right box positioned at -rb.w (backward) matching canvas renderer
- End box rotated 90° (perpendicular to line) in canvas, export, and hit-testing
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace bounding-box hit test with proper shape-aware check that tests
proximity to line segments and oriented end boxes with 8px hit margin,
making the thin EPC much easier to select and drag.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Just expand w/h to cover the full waypoint extent without moving
sym.x/y. The origin-shifting math was causing the symbol to jump
in the direction of waypoint movement on mouse release.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
recalcEpcBounds now properly normalizes the bounding box to start at
(0,0) in local space, adjusting sym.x/y to compensate so the world
position and rotation center stay constant. Handles rotated symbols
by rotating the center offset into world space.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Updating sym.w/h mid-drag shifted the rotation center used by
toSymbolLocal, causing waypoints to jump. Now recalcEpcBounds
only runs on mouseup, keeping the coordinate transform stable.
Also removed the endpoint slide constraint that was causing
instability due to using the moving position as direction source.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- First/last waypoints now only extend/shorten along their segment direction,
preventing unwanted rotation of the end boxes
- Middle waypoints remain freely draggable for direction changes
- Add default middle waypoint so new EPCs have 3 control points
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Increase EPC line width from 0.4 to 1.5 for visibility
- Increase right box stroke from 0.3 to 1.0 to match left icon stroke
- Fix right box to extend behind last waypoint (like left icon), not forward
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
All three now use identical 20x20 viewBox, 19x19 rect, font-size 8,
centered text with dominant-baseline="central". Updated symbol defs
to match the new 20x20 dimensions.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Reduced font sizes and used dominant-baseline="central" with y at
the vertical center so text is centered both horizontally and
vertically inside the box without overlapping the border.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>