Skip to content

GCP2 Zones – Shared style variable causes ellipse rendering in “Project Zone / Cloud Service Provider” #5509

@alxdrl

Description

@alxdrl

Preflight Checklist

  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Describe the bug

Project Zone / Cloud Service Provider” stencil in the GCP2 / Zones palette is rendered as an ellipse instead of a rounded rectangle.

The shape is rendered as an ellipse, with style including: shape=ellipse; perimeter=ellipsePerimeter; ...

Analysis

In Sidebar.prototype.addGCP2ZonesPalette:

var s = 'sketch=0;...;whiteSpace=wrap;';

Later in the same function:

this.addEntry(dt + 'markers', function()
{
    s = 'shape=ellipse;perimeter=ellipsePerimeter;...';

Because s is defined in the parent function scope and captured by closures, this reassignment mutates the shared style used by other entries (including “Project Zone / Cloud Service Provider”).

The bug may appear inconsistently depending on palette initialization order.

To Reproduce

Steps to reproduce the behavior:

  1. Open VSCode
  2. Install https://marketplace.visualstudio.com/items?itemName=hediet.vscode-drawio
  3. Create a file test.drawio.png
  4. Open the file with the extension
  5. Click "More Shape"
  6. Add the "Google Cloud Platform" Library
  7. Open the GCP / Zones
  8. Add the "Project Zone / Cloud Service Provider" stencil

Expected behavior

Shapes should be rectangle without shape=ellipse; perimeter=ellipsePerimeter; style

Screenshots

Actual:
Image

Expected:
Image

draw.io version (In the Help->About menu of the draw.io editor):

  • draw.io version v26.0.2 (extension v1.9.250226013)

Desktop (please complete the following information):

  • OS: Windows 11
  • VSCode 1.112.0

I tested the problem in incognito/private mode with all browser extensions switched off, write "yes" below:
yes

Additional context
Does not happen with Browser version v29.6.5 w/ Chrome 146.0.7680.153

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions