Slate Geometry coordinates incorrect or misunderstood

Hi all. I am trying to move a widget via the mouse cursor using OnMouseMove in slate. From my understanding, absolute coordinates are from the top-left of the gameplay viewport/screen, and local coordinates are obviously from the top-left of the widget. However the absolute coordinates I am getting for either the mouse position or the widget position seems to be very different from the rendered position.

For clarity, this widget, SInventoryDisplay, is a child of some Horizontal and Vertical boxes, which are children of an Overlay. If this changes how geometry works, please let me know as I had zero clue if so.

This is some code I wrote to display a border in the position that MyGeometry.GetAbsolutePosition() returns:

void SInventoryDisplay::OnMouseEnter(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent)
{
	const FVector2D Pos = MyGeometry.GetAbsolutePosition();
	Brush = FSlateBrush();
	SAssignNew(WTest, SConstraintCanvas).Visibility(EVisibility::HitTestInvisible)
		+ SConstraintCanvas::Slot()
		.AutoSize(true)
		.Offset(FMargin(Pos.X, Pos.Y, 0, 0))
		.Alignment(FVector2D(0, 0))
		.Anchors(FAnchors(0, 0, 1, 1))
		[
			SNew(SBorder).ColorAndOpacity(FColor::Green).BorderImage(&Brush)
		];
	GEngine->GameViewport->AddViewportWidgetContent(WTest.ToSharedRef());
}

Which produces this result:


Try to ignore the debug text and icons. The widget in question, SInventoryDisplay, is from the top-left of the grid, including the gray outline. The white box is the border I create. For clarity, I want the white box to match the top left of the grid/inventory display.

Why does the border not line up? Am I missing scaling/DPI calculations? Do I have an incorrect understanding of absolute coordinates? Or am I somehow getting in correct geometry (which I doubt is the case)?

Thank you for your time.

Did you try another art asset for that slot maybe that one has a pad of pixels? Also if your UI widget might have a pad around 4,2,2,4 I think is the default.

I’m not really doing anything with the slots themselves. Essentially, I’m trying to line up the widget with the grid, SInventoryDisplay, with the border, but for now treating the grid as a widget/border as well.

I doubt it’s an issue with padding though. If it was, the white border would be off by a few pixels, not a few hundred. At least that’s what I assume, I could be wrong.