Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
2626f80b
Commit
2626f80b
authored
Jan 24, 2016
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jan 25, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Don't check for line overflow for DWRITE_WORD_WRAPPING_NO_WRAP mode.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
10b843bb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
6 deletions
+24
-6
layout.c
dlls/dwrite/layout.c
+2
-1
layout.c
dlls/dwrite/tests/layout.c
+22
-5
No files found.
dlls/dwrite/layout.c
View file @
2626f80b
...
...
@@ -1606,7 +1606,8 @@ static HRESULT layout_compute_effective_runs(struct dwrite_textlayout *layout)
}
overflow
=
layout
->
clustermetrics
[
i
].
canWrapLineAfter
&&
(
width
+
layout
->
clustermetrics
[
i
].
width
>
layout
->
metrics
.
layoutWidth
);
(
width
+
layout
->
clustermetrics
[
i
].
width
>
layout
->
metrics
.
layoutWidth
)
&&
(
layout
->
format
.
wrapping
!=
DWRITE_WORD_WRAPPING_NO_WRAP
);
/* check if we got new */
if
(
overflow
||
layout
->
clustermetrics
[
i
].
isNewline
||
/* always wrap on new line */
...
...
dlls/dwrite/tests/layout.c
View file @
2626f80b
...
...
@@ -1084,7 +1084,6 @@ if (0) {/* crashes on native */
metrics
.
supportsSideways
=
TRUE
;
hr
=
IDWriteInlineObject_GetMetrics
(
sign
,
&
metrics
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
todo_wine
ok
(
metrics
.
width
>
0
.
0
,
"got %.2f
\n
"
,
metrics
.
width
);
ok
(
metrics
.
height
==
0
.
0
,
"got %.2f
\n
"
,
metrics
.
height
);
ok
(
metrics
.
baseline
==
0
.
0
,
"got %.2f
\n
"
,
metrics
.
baseline
);
...
...
@@ -1786,7 +1785,6 @@ todo_wine
hr
=
IDWriteInlineObject_GetMetrics
(
trimm
,
&
inline_metrics
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
todo_wine
ok
(
inline_metrics
.
width
>
0
.
0
&&
inline_metrics
.
width
==
metrics
[
0
].
width
,
"got %.2f, expected %.2f
\n
"
,
inline_metrics
.
width
,
metrics
[
0
].
width
);
...
...
@@ -3314,7 +3312,6 @@ static void test_SetTextAlignment(void)
hr
=
IDWriteTextLayout_GetMetrics
(
layout
,
&
metrics
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
metrics
.
left
==
metrics
.
layoutWidth
-
metrics
.
width
,
"got %.2f
\n
"
,
metrics
.
left
);
todo_wine
ok
(
metrics
.
width
==
5
*
clusters
[
0
].
width
,
"got %.2f
\n
"
,
metrics
.
width
);
ok
(
metrics
.
lineCount
==
1
,
"got %d
\n
"
,
metrics
.
lineCount
);
IDWriteTextLayout_Release
(
layout
);
...
...
@@ -3705,11 +3702,13 @@ static void test_pixelsnapping(void)
static
void
test_SetWordWrapping
(
void
)
{
static
const
WCHAR
strW
[]
=
{
'a'
,
0
};
static
const
WCHAR
strW
[]
=
{
'a'
,
' '
,
's'
,
'o'
,
'm'
,
'e'
,
' '
,
't'
,
'e'
,
'x'
,
't'
,
' '
,
'a'
,
'n'
,
'd'
,
' '
,
'a'
,
' '
,
'b'
,
'i'
,
't'
,
' '
,
'm'
,
'o'
,
'r'
,
'e'
,
'\n'
,
'b'
};
IDWriteTextFormat
*
format
;
IDWriteTextLayout
*
layout
;
IDWriteFactory
*
factory
;
DWRITE_WORD_WRAPPING
v
;
UINT32
count
;
HRESULT
hr
;
factory
=
create_factory
();
...
...
@@ -3721,7 +3720,7 @@ static void test_SetWordWrapping(void)
v
=
IDWriteTextFormat_GetWordWrapping
(
format
);
ok
(
v
==
DWRITE_WORD_WRAPPING_WRAP
,
"got %d
\n
"
,
v
);
hr
=
IDWriteFactory_CreateTextLayout
(
factory
,
strW
,
1
,
format
,
500
.
0
,
100
.
0
,
&
layout
);
hr
=
IDWriteFactory_CreateTextLayout
(
factory
,
strW
,
sizeof
(
strW
)
/
sizeof
(
WCHAR
),
format
,
10
.
0
f
,
100
.
0
f
,
&
layout
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
v
=
IDWriteTextLayout_GetWordWrapping
(
layout
);
...
...
@@ -3736,6 +3735,24 @@ static void test_SetWordWrapping(void)
v
=
IDWriteTextFormat_GetWordWrapping
(
format
);
ok
(
v
==
DWRITE_WORD_WRAPPING_WRAP
,
"got %d
\n
"
,
v
);
/* disable wrapping, text has explicit newline */
hr
=
IDWriteTextLayout_SetWordWrapping
(
layout
,
DWRITE_WORD_WRAPPING_NO_WRAP
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
count
=
0
;
hr
=
IDWriteTextLayout_GetLineMetrics
(
layout
,
NULL
,
0
,
&
count
);
ok
(
hr
==
E_NOT_SUFFICIENT_BUFFER
,
"got 0x%08x
\n
"
,
hr
);
todo_wine
ok
(
count
==
2
,
"got %u
\n
"
,
count
);
hr
=
IDWriteTextLayout_SetWordWrapping
(
layout
,
DWRITE_WORD_WRAPPING_WRAP
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
count
=
0
;
hr
=
IDWriteTextLayout_GetLineMetrics
(
layout
,
NULL
,
0
,
&
count
);
ok
(
hr
==
E_NOT_SUFFICIENT_BUFFER
,
"got 0x%08x
\n
"
,
hr
);
ok
(
count
>
2
,
"got %u
\n
"
,
count
);
IDWriteTextLayout_Release
(
layout
);
IDWriteTextFormat_Release
(
format
);
IDWriteFactory_Release
(
factory
);
...
...
Write
Preview
Markdown
is supported
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