Skip to content

Validate scene rendering (#470) - #524

Open
Remex9 wants to merge 7 commits into
mainfrom
feature/470-validate-scene-rendering
Open

Remex9 wants to merge 7 commits into
mainfrom
feature/470-validate-scene-rendering

Conversation

@Remex9

@Remex9 Remex9 commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

Pull Request Summary

Closes #471, Closes #472, Closes #473, Closes #474, Closes #475, Closes #476
Related to #470

Checks that images, highlights, lines and labels are drawn where they were saved, at every zoom level and screen size. Fixes four rendering bugs found along the way. Results and remaining defects are in docs/rendering-validation/README.md.

PR Checklist

  • Project builds and runs (scenes reviewed in the browser at desktop, tablet and phone sizes)
  • Tests and linters pass (npx jest: 977 passed, 5 skipped; npm run lint clean)
  • Any related documentation has been updated, including JSDoc comments or docstrings

Detailed Description

Fixes

  • Resizing a cropped image now scales the crop (before, it showed a different part of the bone and the save could fail).
  • Flipped, cropped images are outlined on the right side, and their handles move the right way.
  • Labels are centered in their box (they sat up to ~30 px too far left).

Validation

  • New tests in sceneRendering.test.js and renderingValidation.test.js.
  • In the browser: regions and lines 0 px off, labels within ~1 px, from 25% to 800% zoom and from phone to desktop.

Known limitations (need their own issues): overlapping images draw their highlights over each other; most bonesets don't record which view an image shows; hand_right_image.jpg is sideways.

Document what the order of a scene's images and annotations means, test
that the renderer draws and picks images in that order, and record that
annotations are not stacked with their own image (R1).
Write down the intended view of the sample images, check that no image
file carries an EXIF rotation, that imports are upright and unflipped,
and that saved rotations and flips are drawn about the image's center.
Record that most bonesets have no view captions (R2) and that
hand_right_image.jpg is on its side (R3).
Check that rotated images keep their proportions and that crops are
clipped and turned with their image. Fix three bugs found on the way:
resizing a cropped image now scales the crop, so it keeps showing the
same part of the bone and the save is no longer rejected; a flipped,
cropped image is outlined where it is drawn; and handles on a flipped
image move the corner they sit on.
…e-scene-rendering

# Conflicts:
#	templates/js/scenes.js
Check that a colored region stays on the same spot of its image when the
image is moved, resized, rotated, flipped or cropped, by comparing each
point with the transform the image itself is drawn with. Record the
browser measurements at different zoom levels, while panned, and after
resizing the window.
Check that pointer lines, arrows and labels stay on the same spot of
their image under every kind of image change, and record the browser
measurements at different zoom levels and window sizes.

Draw labels centered in their box. Real text is narrower than the
estimated box, so labels drawn from the box's left edge sat up to about
30px left of where they were placed. Record that pointer lines come away
from upright labels when an image is rotated (R4).
Record the alignment measurements for desktop, small laptop, tablet,
phone and phone landscape, including turning a phone with a scene open.
Nothing was more than 1.5 screen px off at any size. Record that labels
are too small to read on a phone until the scene is zoomed in (R5).
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant