You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fit or stretch background images within the map canvas - #298
Selecting a background previously changed the canvas to the image dimensions. Add Fit, Stretch and original Image size choices to Map Properties, persisted as a background_sizing hint.
Fit centers the image within the current canvas while preserving proportions; Stretch fills the canvas. Image size preserves existing behavior. Missing or invalid hints use Image size for compatibility. PHP locals follow snake_case conventions.
Validation: 226 PHP 8.3 tests passed in an isolated fixture layout. A real-engine regression saves each mode through setMapProperties(), reloads it, renders the image and checks canvas dimensions and pixels. It also checks invalid editor input preserves the existing hint and invalid stored hints use the renderer fallback. Syntax, whitespace and manifest checks passed; measured changed-line coverage is 100%, with existing editor entry/action exemptions. Full running-installation integration remains unverified for this revision.
Further review follow-up
Addressed in 2824a1e. Moved background_sizing lookup and validation after the post-processing loop. Added actual engine rendering checks for post-processor overrides to fit, stretch, image and an invalid value, verifying canvas dimensions and background pixels. All 226 plugin tests pass (5437 assertions); measured changed-line coverage passes at 19/19.
The fit-mode assertion only proves that the letterbox pixel is not red. A regression that never copies the fitted image would still pass, because the canvas background also satisfies this condition. Please also assert that a pixel inside the expected fitted area is red so the test verifies the image was rendered, not merely that padding exists.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Selecting a background previously changed the canvas to the image dimensions. Add Fit, Stretch and original Image size choices to Map Properties, persisted as a background_sizing hint.
Fit centers the image within the current canvas while preserving proportions; Stretch fills the canvas. Image size preserves existing behavior. Missing or invalid hints use Image size for compatibility. PHP locals follow snake_case conventions.
Validation: 226 PHP 8.3 tests passed in an isolated fixture layout. A real-engine regression saves each mode through setMapProperties(), reloads it, renders the image and checks canvas dimensions and pixels. It also checks invalid editor input preserves the existing hint and invalid stored hints use the renderer fallback. Syntax, whitespace and manifest checks passed; measured changed-line coverage is 100%, with existing editor entry/action exemptions. Full running-installation integration remains unverified for this revision.
Further review follow-up
Addressed in 2824a1e. Moved background_sizing lookup and validation after the post-processing loop. Added actual engine rendering checks for post-processor overrides to fit, stretch, image and an invalid value, verifying canvas dimensions and background pixels. All 226 plugin tests pass (5437 assertions); measured changed-line coverage passes at 19/19.