Repository navigation
Add Bevel and City shading styles - #1
Merged
Merged
Conversation
…-right rim A third map style beside Cushion and Flat. Each file is an even fill with a two-pixel rim lightened along the top and left edges and darkened along the bottom and right, so it reads as lit from the upper left like the cushions but with hard edges. Small rectangles get a one-pixel rim, under 3 px none. The toolbar's Cushions checkbox becomes a Cushion / Flat / Bevel switch and View > Cushion Shading becomes a View > Shading submenu with radio items on both the in-window and macOS menu bars. Settings store the style as a `shading` key and keep writing `cushions` so 0.1.1 still reads the file. Pixel-invariant tests cover the rims and the thin-rim fallback; menu, toolbar and settings tests follow the new switch. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A fourth style beside Cushion, Flat and Bevel. Every painted rectangle is a building: its footprint is the rectangle less a one-pixel street on the right and bottom, widened by 1.5 px per enclosing folder that ends on that edge, so folders read as city blocks between avenues; its height is the cube root of its size relative to the biggest item in view, up to a tenth of the raster's shorter side (8-56 px), and flat under 2 px. Buildings are drawn in an oblique projection (roof moved up one pixel and left half a pixel per pixel of height, right wall at 0.7, bottom wall at 0.5 brightness) with a per-band depth buffer, so the parallel bands stay independent of paint order. Only the pixels are 3D: hit testing, hover and the outlines still use the footprint. The toolbar switch and View > Shading gain a City entry; settings store it as "cityscape". Tests: a one-file raster checks the roof offset, both walls and the street; the fixture checks heights by cube root, wider streets on folder edges, visible ground and that nothing is lit beyond a roof. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Two new map styles beside Cushion and Flat: Bevel and City.
Bevel. Each file is an even fill with a two-pixel rim lightened along the top and left edges and darkened along the bottom and right, so it reads as lit from the upper left like the cushions but with hard edges. Small rectangles get a one-pixel rim, and anything under 3 px gets none.
render/raster.rs:Shading::Bevelwithpaint_bevel, plusShading::ALL,key,from_keyandlabelhelpers (mirroringTheme).SHADING_ID).Command::ToggleCushionsbecomesCommand::Shading(Shading)with idsview.shading.{cushion,flat,bevel}. The macOS menu bar follows through the shared spec.shadingkey;cushionsis still written so 0.1.1 reads the file unchanged, and old files with onlycushionsstill load.City (second commit). The map as a cityscape seen from above and a little to the lower right. Every painted rectangle is a building: its footprint is the rectangle less a one-pixel street on the right and bottom, widened by 1.5 px per enclosing folder that ends on that edge (so folders read as city blocks between avenues); its height is the cube root of its size relative to the biggest item in view, up to a tenth of the raster's shorter side (8–56 px), and flat under 2 px. Buildings are drawn in an oblique projection (roof moved up one pixel and left half a pixel per pixel of height, right wall at 0.7, bottom wall at 0.5) with a per-band depth buffer, so the parallel row bands stay independent of paint order.
render/city.rs:Building,plan(footprints, streets, heights) andpaint;raster.rsbins by the buildings' projected extents and allocates the depth buffer per band.cityscape.Tests
bevel_mode_has_a_light_top_left_rim_and_a_dark_bottom_right_rimandtiny_bevelled_rectangles_get_a_thin_rim_or_none(pixel invariants, same style as the cushion and flat tests).a_cityscape_building_has_a_raised_roof_two_walls_and_a_street(one-file raster: roof offset, both walls, the street) andbigger_files_make_taller_buildings_and_streets_widen_at_folder_edges(cube-root heights, wider streets on folder edges, visible ground, nothing lit beyond a roof).the_shading_key_wins_over_the_old_cushions_flag.cargo test --workspace,cargo clippy --workspace --all-targets -- -D warningsandcargo fmtare green on macOS (Apple Silicon).Bevel and City on the laptop-ssd demo drive, light theme:
🤖 Generated with Claude Code