Hi Team, we found following error in the documentation which gave us a headache:
ThinkGeo.Core PdfGeoCanvas / SkiaGeoCanvas — GeoCanvas.DrawTextWithScreenCoordinate positions text at vertical (and horizontal) center , not upper-left, contradicting its own parameter names and XML doc
Package: ThinkGeo.Core 15.0.0-beta104 (also present in SkiaGeoCanvas / PdfGeoCanvas ; likely affects any GeoCanvas implementation using the same base method)
API in question:
public void DrawTextWithScreenCoordinate(string text, GeoFont font, GeoBrush fillBrush,
float upperLeftXInScreen, float upperLeftYInScreen, DrawingLevel drawingLevel)
Documented behavior (per XML doc comments on the parameters):
upperLeftXInScreen: “the upper left horizontal point in screen coordinates of where you want to start drawing the text from.”upperLeftYInScreen: “the upper left vertical point in screen coordinates of where […]”
Actual behavior: the (x, y) passed is treated as the center of the text’s bounding box, not its upper-left corner. Confirmed by rendering test output — text drawn at y=75 on an otherwise-empty canvas straddles y=75 symmetrically (ascender extends up ~half the measured MeasureText(...).Height , descender extends down the same amount), rather than starting at y=75 and extending downward as the parameter name promises.
Repro:
var canvas = new PdfGeoCanvas { PageWidth = 300f, PageHeight = 150f };
using var stream = new MemoryStream();
canvas.BeginDrawing(stream, new RectangleShape(0, 150, 300, 0), GeographyUnit.Meter);
var font = new GeoFont("Segoe UI", 20f);
canvas.DrawTextWithScreenCoordinate("Mgy", font, new GeoSolidBrush(GeoColors.Black), 150f, 75f, DrawingLevel.LevelOne);
canvas.EndDrawing();
// Rendered glyph is vertically centered on y=75, not top-aligned at y=75.


