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
28cc0f9e
Commit
28cc0f9e
authored
Jan 01, 2008
by
Eric Pouech
Committed by
Alexandre Julliard
Jan 02, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
richedit: Fix the para computation when zoom is used.
parent
f4fd0631
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
16 deletions
+15
-16
editor.h
dlls/riched20/editor.h
+1
-0
paint.c
dlls/riched20/paint.c
+11
-13
wrap.c
dlls/riched20/wrap.c
+3
-3
No files found.
dlls/riched20/editor.h
View file @
28cc0f9e
...
...
@@ -214,6 +214,7 @@ BOOL ME_UpdateSelection(ME_TextEditor *editor, const ME_Cursor *pTempCursor);
BOOL
ME_WrapMarkedParagraphs
(
ME_TextEditor
*
editor
);
void
ME_InvalidateMarkedParagraphs
(
ME_TextEditor
*
editor
);
void
ME_SendRequestResize
(
ME_TextEditor
*
editor
,
BOOL
force
);
int
ME_twips2points
(
ME_Context
*
c
,
int
x
,
int
dpi
);
/* para.c */
ME_DisplayItem
*
ME_GetParagraph
(
ME_DisplayItem
*
run
);
...
...
dlls/riched20/paint.c
View file @
28cc0f9e
...
...
@@ -141,6 +141,13 @@ ME_RewrapRepaint(ME_TextEditor *editor)
ME_Repaint
(
editor
);
}
int
ME_twips2points
(
ME_Context
*
c
,
int
x
,
int
dpi
)
{
if
(
c
->
editor
->
nZoomNumerator
==
0
)
return
x
*
dpi
/
1440
;
else
return
x
*
dpi
*
c
->
editor
->
nZoomNumerator
/
1440
/
c
->
editor
->
nZoomDenominator
;
}
static
void
ME_DrawTextWithStyle
(
ME_Context
*
c
,
int
x
,
int
y
,
LPCWSTR
szText
,
int
nChars
,
ME_Style
*
s
,
int
*
width
,
int
nSelFrom
,
int
nSelTo
,
int
ymin
,
int
cy
)
{
...
...
@@ -167,17 +174,8 @@ static void ME_DrawTextWithStyle(ME_Context *c, int x, int y, LPCWSTR szText, in
if
(
s
->
fmt
.
dwEffects
&
CFE_SUBSCRIPT
)
yTwipsOffset
=
-
s
->
fmt
.
yHeight
/
12
;
}
if
(
yTwipsOffset
)
{
int
numerator
=
1
;
int
denominator
=
1
;
yOffset
=
ME_twips2points
(
c
,
yTwipsOffset
,
GetDeviceCaps
(
hDC
,
LOGPIXELSY
));
if
(
c
->
editor
->
nZoomNumerator
)
{
numerator
=
c
->
editor
->
nZoomNumerator
;
denominator
=
c
->
editor
->
nZoomDenominator
;
}
yOffset
=
yTwipsOffset
*
GetDeviceCaps
(
hDC
,
LOGPIXELSY
)
*
numerator
/
denominator
/
1440
;
}
ExtTextOutW
(
hDC
,
x
,
y
-
yOffset
,
0
,
NULL
,
szText
,
nChars
,
NULL
);
GetTextExtentPoint32W
(
hDC
,
szText
,
nChars
,
&
sz
);
if
(
width
)
*
width
=
sz
.
cx
;
...
...
@@ -329,11 +327,11 @@ void ME_DrawParagraph(ME_Context *c, ME_DisplayItem *paragraph) {
case
diParagraph
:
para
=
&
p
->
member
.
para
;
assert
(
para
);
nMargWidth
=
para
->
pFmt
->
dxStartIndent
*
dpi
/
1440
;
nMargWidth
=
ME_twips2points
(
c
,
para
->
pFmt
->
dxStartIndent
,
dpi
)
;
if
(
pno
!=
0
)
nMargWidth
+=
para
->
pFmt
->
dxOffset
*
dpi
/
1440
;
nMargWidth
+=
ME_twips2points
(
c
,
para
->
pFmt
->
dxOffset
,
dpi
)
;
xs
=
c
->
rcView
.
left
+
nMargWidth
;
xe
=
c
->
rcView
.
right
-
(
para
->
pFmt
->
dxRightIndent
*
dpi
/
1440
);
xe
=
c
->
rcView
.
right
-
ME_twips2points
(
c
,
para
->
pFmt
->
dxRightIndent
,
dpi
);
break
;
case
diStartRow
:
y
+=
height
;
...
...
dlls/riched20/wrap.c
View file @
28cc0f9e
...
...
@@ -352,9 +352,9 @@ static void ME_WrapTextParagraph(ME_Context *c, ME_DisplayItem *tp, DWORD begino
wc
.
context
=
c
;
/* wc.para_style = tp->member.para.style; */
wc
.
style
=
NULL
;
wc
.
nFirstMargin
=
tp
->
member
.
para
.
pFmt
->
dxStartIndent
*
dpi
/
1440
+
beginofs
;
wc
.
nLeftMargin
=
wc
.
nFirstMargin
+
tp
->
member
.
para
.
pFmt
->
dxOffset
*
dpi
/
1440
+
beginofs
;
wc
.
nRightMargin
=
tp
->
member
.
para
.
pFmt
->
dxRightIndent
*
dpi
/
1440
;
wc
.
nFirstMargin
=
ME_twips2points
(
c
,
tp
->
member
.
para
.
pFmt
->
dxStartIndent
,
dpi
)
+
beginofs
wc
.
nLeftMargin
=
wc
.
nFirstMargin
+
ME_twips2points
(
c
,
tp
->
member
.
para
.
pFmt
->
dxOffset
,
dpi
)
+
beginofs
wc
.
nRightMargin
=
ME_twips2points
(
c
,
tp
->
member
.
para
.
pFmt
->
dxRightIndent
,
dpi
)
;
wc
.
nRow
=
0
;
wc
.
pt
.
x
=
0
;
wc
.
pt
.
y
=
0
;
...
...
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