Baseline offset right metrics key misbehaves when @0

This one is hard to explain, so I made a simple test .glyphs file and a diagram below. Basically, if I use a baseline offset right metrics key at zero (=H@0 in the example) it calculates the sidebearing incorrectly if the bottom of the glyph is at y=0. Then if I use it on a similar glyph but with the bottom anywhere below y=0, it inexplicably adds 100 units, incorrect again. The same key on the left side bearing calculates correctly in all cases.

baseline-offset-right-metrics-key.glyphs (6.8 KB)

This is on the latest stable Glyphs 3.1.2 (3151)

Intersecting an edge is a bit tricky. So it is advised to use a value that is inside the outline. e.g. =H@1

Thanks, I suspected that might be the case, although there doesn’t seem to be any problem doing it on the left side bearing.

Either case catches the left edge on the shape (the end of the path triggers the intersection, the start (of the right upwards segment doesn’t). So the LSB is ok.