- procedure TScaledAxis.DrawPitchLineLabel;
- var LabelString: PChar;
- GraphicCurrentLabelPoint: TVector;
- GraphicCurrentLabelPoint2D_Array: Array[0..2] of Double;
- GraphicCurrentLabelPoint2D_ViewPort: TVector;
- GraphicCurrentLabelPoint2D_Clip_X, GraphicCurrentLabelPoint2D_Clip_Y: Single;
- LabelTextExtension: TSize;
- begin
- LabelString := 'Test'; //in the meantime: placeholder
- LabelTextExtension := FCanvas.TextExtent(LabelString);
- //get the dimensions of the textlabel in pixels, is supported by TCanvas
- FTextDistance := Magnitude(Vector(LabelTextExtension.cx, LabelTextExtension.cy, 0));
- //max label elongation is along the diagonal
- glPushMatrix; //this is needed to save the already process graphics
- glLoadIdentity; //move to origin and then
- glTranslatef(0, 0, -(cvpnear+1));
- //move one step into the viewing volume, cvpnear = 0 here
- GraphicCurrentLabelPoint := CorrectGraphicPoint(FGraphicCurrentPoint);
- //CorrectGraphicPoint is a function that turns the y coordinate upside down. Because this was already done in previous processing steps, it has to be revoked here to allow another operation on it.