railmapgen / rmp

Design your own rail map by freely dragging stations from different cities and connecting them with 135-degree rounded corners or perpendicular lines!
https://railmapgen.github.io/?app=rmp
GNU General Public License v3.0
82 stars 15 forks source link

PreComponent and afterComponent #692

Open thekingofcity opened 3 months ago

thekingofcity commented 3 months ago

This feature is utilized for specific scenarios such as MRT out-of-station interchanges and the JR East line style. Typically, these scenarios entail some form of opening in the outline of the element: a white outline for MRT out-of-station interchanges and a black outline for the JR East line style.

image image

Presently, even with z-index, it is not possible to position another element just above the outline and beneath the main element. You're faced with a choice: either place an element beneath both the main element and its outline, or position it above both.

To address this limitation, this proposal suggests expanding the current component into three parts: preComponent, component, and afterComponent. Elements requiring an outline could draw their outline in preComponent, while the main content would reside in either component or afterComponent. It's advisable to render the main content in afterComponent to allow other elements to be positioned between preComponent and afterComponent without requiring adjustments to their z-index.

This feature is assigned a lower priority in terms of z-index, meaning it will only function when elements share the same z-index level. Elements outside this level will either be positioned beneath or above the entire element.