From b1381b8956c232d4e76871a2189aa8949045d452 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Wed, 30 Dec 2009 22:11:45 +0000 Subject: [PATCH] [EXAMPLES] * NEW: Fix the text extend example in Painting example. git-svn-id: svn://localhost/gambas/trunk@2571 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- .../examples/Drawing/Painting/.src/FMain.class | 16 +++++++++++++--- examples/examples/Drawing/Painting/Example17 | 16 +++++++++++++--- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/examples/examples/Drawing/Painting/.src/FMain.class b/examples/examples/Drawing/Painting/.src/FMain.class index fd230266e..c3ec38807 100644 --- a/examples/examples/Drawing/Painting/.src/FMain.class +++ b/examples/examples/Drawing/Painting/.src/FMain.class @@ -424,20 +424,30 @@ Public Sub Example17() Dim sText As String = "gambas" Dim X, Y As Float + Dim hExt As PaintExtents Paint.Font = Font["Sans,100"] X = 25 Y = 150 - Paint.MoveTo(x, y) + Paint.MoveTo(X, Y) + Paint.Save + Paint.Reset + Paint.Text(sText) + hExt = Paint.PathExtents + Paint.Restore + Paint.NewPath + Paint.MoveTo(X, Y) Paint.Text(sText) Paint.Fill Paint.Brush = Paint.Color(Color.RGB(255, 31, 31, 93)) Paint.LineWidth = 6 Paint.Arc(X, Y, 10) - Paint.RelLineTo(0, - Paint.Font.Height(sText)) - Paint.RelLineTo(Paint.Font.Width(sText), 0) + Paint.Fill + Paint.MoveTo(X, Y) + Paint.RelLineTo(0, Paint.Font.Descent - hExt.Height) + Paint.RelLineTo(hExt.Width, 0) Paint.Stroke End diff --git a/examples/examples/Drawing/Painting/Example17 b/examples/examples/Drawing/Painting/Example17 index 825f99ed1..02f9a7107 100644 --- a/examples/examples/Drawing/Painting/Example17 +++ b/examples/examples/Drawing/Painting/Example17 @@ -3,20 +3,30 @@ Public Sub Example17() Dim sText As String = "gambas" Dim X, Y As Float + Dim hExt As PaintExtents Paint.Font = Font["Sans,100"] X = 25 Y = 150 - Paint.MoveTo(x, y) + Paint.MoveTo(X, Y) + Paint.Save + Paint.Reset + Paint.Text(sText) + hExt = Paint.PathExtents + Paint.Restore + Paint.NewPath + Paint.MoveTo(X, Y) Paint.Text(sText) Paint.Fill Paint.Brush = Paint.Color(Color.RGB(255, 31, 31, 93)) Paint.LineWidth = 6 Paint.Arc(X, Y, 10) - Paint.RelLineTo(0, - Paint.Font.Height(sText)) - Paint.RelLineTo(Paint.Font.Width(sText), 0) + Paint.Fill + Paint.MoveTo(X, Y) + Paint.RelLineTo(0, Paint.Font.Descent - hExt.Height) + Paint.RelLineTo(hExt.Width, 0) Paint.Stroke End