GH UI graphics: white border around components

@curtisw, @dan this is a small issue, but could you clean up the GH UI graphics on the macOS side?
There is a mistake regarding the white border surrounding every component, I guess the thickness is too high or sth like that. This becomes especially annoying when working in a dark Grasshopper mode, as the white line now appears “twice” because of its thickness.

Solution suggestions:
a) make it the same thickness as on the Windows side
b) maybe provide a way/description how we can change it ourselves and maybe even turn off some features as needed.

Cheers,
Rudi

It took me a moment to figure out how you were editing the canvas color. You’re modifying grasshopper_gui.xml and setting this value something close to this:

    <item name="canvas_backcolor" type_name="gh_drawing_color" type_code="36">
      <ARGB>255;48;48;48</ARGB>
    </item>

right?

I was just trying to see what you were seeing, because the canvas color doesn’t automatically change when switching macOS to Dark Mode. No matter.

It’s interesting to compare these side-by-side:

@curtisw do you recall why these would be different? At this point, I’ve been staring at the Grasshopper version on Mac long enough it looks natural to me…almost like a design decision.

It’s because there’s a pen property available on GDI+ which is not there on mac. Sort of a perpendicular dash-pattern. You can make a pen draw only on the left-hand-half. This allows me to draw a light border on the inside only without having to offset the graphicspath.

I agree that it would look better without than drawn wrong like this.

Ah ha! Now that you point that out, it jumps out at me. So, if I follow that logic properly, if we removed the light border we’d also lose it on the inside which would definitely look weird.

Or is it that the entire border - the light part and the dark - are one single Pen? (I guess I could hunt this down in source).

Regardless, sounds hard to fix - especially if one tried to approximate it with two draw calls and a slightly smaller inside rectangle.

Thank you for looking into this, it seems that the solution is not worth the effort.
Is there a way, where I can toggle the individual GH UI curves “drawing” on and off? I would like to try and see what this would look like (and if it would also benefit canvas UI performance … which is still not good on macOS)

Thanks a lot,
Rudi

You’d lose the inside highlight, but I don’t think it would look wrong. GH2 doesn’t draw it (or the shiny bar) and it looks fine to me without.

If you really want to keep it I can see about changing the code to not use compound pens and instead offset the pen path one pixel to the inside. Let me know. I just looove digging around my old VB code, but I certainly wouldn’t ask anyone else to do it for me.

Maybe just remove it, as both options are technically/graphically wrong. Let’s choose the simpler wrong option :smiley:

The double border is a side effect of GH using a drawing API that doesn’t quite work the same on Mac, and I have not found a way to make it work that way (it may very well be impossible). Additionally, making it look exactly the same as windows would likely slow things down so I wasn’t keen to fix it.

I have also tested removing elements or simplifying them in the GH canvas and the performance increase is unfortunately minimal.

Can I still remove them for myself somehow? Or is this hardcoded in the compiled version of GH?
Would be great to remove these white borders in my dark mode environment :smiley:

I know that there are more pressing issues right now, would be still cool, though.

and potential cabvas performance gains due to less graphics, that have to be rendered…
@curtisw