@@ -184,13 +184,22 @@ templ SystemContents(system *export_map.System) {
184184 </obj- >
185185 }
186186 for _ , obj := range system.Zones {
187- // can be sphere, ellipsoid, cylinder, box, ring
188- @ SystemObjZone (
189- obj,
190- system,
191- ObjRotAngle(obj.Rotation.X, obj.Rotation.Y, obj.Rotation.Z),
192- ObjRotLength(obj.Rotation.X, obj.Rotation.Y, obj.Rotation.Z),
193- )
187+ if obj.ZoneShape != " cylinder" {
188+ // can be sphere, ellipsoid, cylinder, box, ring
189+ @ SystemObjZone (
190+ obj,
191+ system,
192+ ObjRotAngle(obj.Rotation.X, obj.Rotation.Y, obj.Rotation.Z),
193+ ObjRotLength(obj.Rotation.X, obj.Rotation.Y, obj.Rotation.Z),
194+ )
195+ } else {
196+ @ SystemObjZone (
197+ obj,
198+ system,
199+ ObjRotAngle(obj.Rotation.X+90, obj.Rotation.Y, obj.Rotation.Z),
200+ ObjRotLength(obj.Rotation.X+90, obj.Rotation.Y, obj.Rotation.Z),
201+ )
202+ }
194203 }
195204 @ TooltipTippy (ObjectsToTipppy (
196205 system.Zones ,
@@ -243,7 +252,8 @@ templ SystemObjZone(obj *export_map.Zone, system *export_map.System, ROT_ANGLE f
243252 class ={
244253 " zone" ,
245254 " unhidden_zone" ,
246- " hidden_all_zone" ,
255+ templ.KV (" hidden_all_zone" , obj.ZoneShape != " cylinder" ),
256+ templ.KV (" hiddenCylinderZone" , obj.ZoneShape == " cylinder" ),
247257 GetZoneClass (obj.PropertyFlags , system),
248258 templ.KV (" roundZone" , obj.ZoneShape == " ellipsoid" || obj.ZoneShape == " sphere" ),
249259 templ.KV (" cylinderZone" , obj.ZoneShape == " cylinder" ),
@@ -266,6 +276,8 @@ templ SystemObjZone(obj *export_map.Zone, system *export_map.System, ROT_ANGLE f
266276 SystemPosToPerc (obj.Pos .X , system),
267277 ),
268278 fmt.Sprintf (" transform: rotate(%.1f deg)" , ROT_ANGLE ),
279+ fmt.Sprintf (" transform: rotate(%.1f deg)" , ROT_ANGLE ),
280+
269281 " position: absolute" ,
270282
271283 templ.KV (fmt.Sprintf (" margin-top: %.5f%% " , -SizeInPerc (float64 (obj.Size .Z ), system)), obj.ZoneShape == " ellipsoid" ),
@@ -283,9 +295,9 @@ templ SystemObjZone(obj *export_map.Zone, system *export_map.System, ROT_ANGLE f
283295 templ.KV (fmt.Sprintf (" height: %.5f%% " , 2 *SizeInPerc (float64 (obj.Size .X )*ROT_LENGTH, system)), obj.ZoneShape == " sphere" ),
284296 templ.KV (fmt.Sprintf (" width: %.5f%% " , 2 *SizeInPerc (float64 (obj.Size .X ), system)), obj.ZoneShape == " sphere" ),
285297
286- templ.KV (fmt.Sprintf (" margin-top: %.5f%% " , -SizeInPerc (float64 (obj.Size .Y ), system)), obj.ZoneShape == " cylinder" ),
298+ templ.KV (fmt.Sprintf (" margin-top: %.5f%% " , -SizeInPerc (float64 (obj.Size .Y ), system)/ 2 ), obj.ZoneShape == " cylinder" ),
287299 templ.KV (fmt.Sprintf (" margin-left: %.5f%% " , -SizeInPerc (float64 (obj.Size .X ), system)), obj.ZoneShape == " cylinder" ),
288- templ.KV (fmt.Sprintf (" height: %.5f%% " , 2 * SizeInPerc (float64 (obj.Size .Y )*ROT_LENGTH, system)), obj.ZoneShape == " cylinder" ),
300+ templ.KV (fmt.Sprintf (" height: %.5f%% " , SizeInPerc (float64 (obj.Size .Y )*ROT_LENGTH, system)), obj.ZoneShape == " cylinder" ),
289301 templ.KV (fmt.Sprintf (" width: %.5f%% " , 2 *SizeInPerc (float64 (obj.Size .X ), system)), obj.ZoneShape == " cylinder" ),
290302
291303 // if it is vertical object, than its size is controled by its width :]
0 commit comments