@Giosk wrote:
I’m using bowtie font in GoJS, I imported the font using the font face in css as you can see here:
@font-face { font-family: "Bowtie"; src: local("Bowtie"), url("./fonts/Bowtie.eot"); src: local("Bowtie"), url("./fonts/Bowtie.eot?#iefix") format("embedded-opentype"), url("./fonts/Bowtie.woff2") format("woff2"), url("./fonts/Bowtie.ttf") format("truetype"), url("./fonts/Bowtie.woff") format("woff"), url("./fonts/Bowtie.svg#Bowtie") format("svg"); font-weight: normal; font-style: normal; } .bowtie-alert { content: "\e600"; } .bowtie-approve { content: "\e601"; } .bowtie-approve-disapprove { content: "\e602"; }
I used the solution found here and I created an adornment menu with a textblock like this one
$(go.TextBlock, { text: "\ue669", font: "14px Bowtie", stroke: "#fff", desiredSize: new go.Size(16, 16), })
in particular using the define builder like this
const makeGObject = function(name) { return $(go.TextBlock, { text: "\ue669", font: "14px Bowtie", stroke: "#fff", desiredSize: new go.Size(16, 16), }) } go.GraphObject.defineBuilder("ButtonWithoutHighlight", function(args) { const { name } = args[1] let button = $("Button", makeGObject(name)) let border = button.findObject("ButtonBorder") if (border instanceof go.Shape) { border.stroke = null border.fill = "transparent" } button.mouseEnter = function(e, button, prev) { let shape = button.findObject("ButtonBorder") if (shape instanceof go.Shape) { border.stroke = null border.fill = "transparent" } } button.mouseLeave = function(e, button, prev) { let shape = button.findObject("ButtonBorder") if (shape instanceof go.Shape) { border.stroke = null border.fill = "transparent" } } return button })
The result is very strange, because when I click the first time on my entity the adornment menu appears like that
then if I dismiss the menu and I click again or if I resize the window the menu appears like that
What can I do?
Thanks
Posts: 3
Participants: 2