Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
What's new
4
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Menu
Open sidebar
FPC
Lazarus
Lazarus
Commits
dbe90566
Commit
dbe90566
authored
Aug 25, 2012
by
Željan Rikalo
🏊🏼
Browse files
Gtk2,Qt: make ETO_OPAQUE work from TCanvas.TextOut(). issue
#22719
git-svn-id: trunk@38373 -
parent
1ffcfe06
Changes
2
Hide whitespace changes
Inline
Side-by-side
lcl/interfaces/gtk2/gtk2winapi.inc
View file @
dbe90566
...
...
@@ -3823,6 +3823,7 @@ var
Foreground
,
BackgroundColor
:
PGDKColor
;
CurDx
:
PInteger
;
CurStr
:
PChar
;
R
:
TRect
;
procedure
DoTextOut
(
X
,
Y
:
Integer
;
Str
:
Pchar
;
CurCount
:
Integer
);
var
...
...
@@ -3854,12 +3855,14 @@ begin
if
DevCtx
.
GC
<>
nil
then
;
// create GC
if
((
Options
and
(
ETO_OPAQUE
+
ETO_CLIPPED
))
<>
0
)
and
(
Rect
=
nil
)
then
begin
DebugLn
(
'WARNING: [TGtk2WidgetSet.ExtTextOut] Rect=nil'
);
Result
:=
False
;
exit
;
if
((
Options
and
(
ETO_OPAQUE
+
ETO_CLIPPED
))
<>
0
)
and
(
Rect
=
nil
)
then
begin
R
:=
RectFromGdkRect
(
DevCtx
.
ClipRect
);
OffsetRect
(
R
,
-
R
.
Left
,
-
R
.
Top
);
OffsetRect
(
R
,
X
,
Y
);
DrawText
(
DC
,
Str
,
Count
,
R
,
DT_SINGLELINE
or
DT_CALCRECT
);
Rect
:=
@
R
;
end
;
BackgroundColor
:=
nil
;
...
...
@@ -3868,12 +3871,12 @@ begin
DCOrigin
:=
DevCtx
.
Offset
;
if
(
Options
and
ETO_CLIPPED
)
<>
0
then
begin
if
(
Options
and
ETO_CLIPPED
)
<>
0
then
begin
X
:=
Rect
^.
Left
;
Y
:=
Rect
^.
Top
;
IntersectClipRect
(
DC
,
Rect
^.
Left
,
Rect
^.
Top
,
Rect
^.
Right
,
Rect
^.
Bottom
);
Rect
^.
Right
,
Rect
^.
Bottom
);
end
;
if
DevCtx
.
HasTransf
then
...
...
lcl/interfaces/qt/qtwinapi.inc
View file @
dbe90566
...
...
@@ -2181,6 +2181,7 @@ var
WideStr
:
WideString
;
QtDC
:
TQtDeviceContext
absolute
DC
;
B
:
Boolean
;
R
,
R1
:
TRect
;
begin
{
$ifdef
VerboseQtWinAPI
}
WriteLn
(
'[WinAPI ExtTextOut]'
);
...
...
@@ -2188,13 +2189,21 @@ begin
Result
:=
False
;
if
((
Options
and
(
ETO_OPAQUE
+
ETO_CLIPPED
))
<>
0
)
and
(
Rect
=
nil
)
then
exit
;
if
not
IsValidDC
(
DC
)
then
Exit
;
if
((
Options
and
ETO_OPAQUE
)
<>
0
)
then
QtDC
.
fillRect
(
Rect
^.
Left
,
Rect
^.
Top
,
Rect
^.
Right
-
Rect
^.
Left
,
Rect
^.
Bottom
-
Rect
^.
Top
);
if
((
Options
and
(
ETO_OPAQUE
+
ETO_CLIPPED
))
<>
0
)
and
(
Rect
=
nil
)
then
begin
if
Count
>=
0
then
WideStr
:=
GetUtf8String
(
Copy
(
Str
,
1
,
Count
))
else
WideStr
:=
GetUtf8String
(
Str
);
R
:=
QtDC
.
getClipRegion
.
getBoundingRect
;
QtDC
.
font
.
Metrics
.
boundingRect
(
@
R1
,
@
R
,
0
,
@
WideStr
);
Rect
:=
@
R1
;
end
else
if
((
Options
and
ETO_OPAQUE
)
<>
0
)
and
(
Rect
<>
nil
)
then
QtDC
.
fillRect
(
Rect
^.
Left
,
Rect
^.
Top
,
Rect
^.
Right
-
Rect
^.
Left
,
Rect
^.
Bottom
-
Rect
^.
Top
);
if
Str
<>
nil
then
begin
...
...
FPC Admin account
@fpc_admin
mentioned in issue
#22719 (closed)
·
Jul 28, 2021
mentioned in issue
#22719 (closed)
mentioned in issue #22719
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment