Margin between Buttton and Image


I am putting a image inside a Button. But there is a margin between image and button. Can you tell me how to remove that margin?
Thanks a lot


First, you should look at how “Button” is defined, at

From that you can see that it sets the Shape.spot1 and Shape.spot2 properties to control where the content will be positioned in that “Auto” Panel relative to the Shape.

So you just need to set those two properties to the values that you want. For example, this removes the padding completely:

        { "ButtonBorder.spot1": go.Spot.TopLeft, "ButtonBorder.spot2": go.Spot.BottomRight },
        $(go.Picture, ...),
        { click: ... }

Thanks walter. It worked :)

Hi Walter,

One more question.
How to change the border color which is now “Dodger blue”?


You mean the background gradient? Or something else? Look at the definition in extensions/Buttons.js and make corresponding modifications.

I mean the Dark blue color not the faint background color.
And i checked Buttons.js and i didn’t finf anything related to border color.


Perhaps you are talking about the selection Adornment/handle. GoJS Selection -- Northwoods Software