Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jlib
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
captainwong
jlib
Commits
9aa20c50
Commit
9aa20c50
authored
8 years ago
by
captainwong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix some bug about rc op
parent
e40ba8f1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
9 deletions
+13
-9
win32.h
win32.h
+13
-9
No files found.
win32.h
View file @
9aa20c50
...
@@ -150,15 +150,15 @@ inline auto Height(LPCRECT rc) {
...
@@ -150,15 +150,15 @@ inline auto Height(LPCRECT rc) {
inline
void
DeflateRect
(
LPRECT
rc
,
int
l
,
int
t
,
int
r
,
int
b
)
{
inline
void
DeflateRect
(
LPRECT
rc
,
int
l
,
int
t
,
int
r
,
int
b
)
{
rc
->
left
+=
l
;
rc
->
left
+=
l
;
rc
->
top
+=
t
;
rc
->
top
+=
t
;
rc
->
right
+
=
r
;
rc
->
right
-
=
r
;
rc
->
bottom
+
=
b
;
rc
->
bottom
-
=
b
;
}
}
inline
void
InflateRect
(
LPRECT
rc
,
int
l
,
int
t
,
int
r
,
int
b
)
{
inline
void
InflateRect
(
LPRECT
rc
,
int
l
,
int
t
,
int
r
,
int
b
)
{
rc
->
left
-=
l
;
rc
->
left
-=
l
;
rc
->
top
-=
t
;
rc
->
top
-=
t
;
rc
->
right
-
=
r
;
rc
->
right
+
=
r
;
rc
->
bottom
-
=
b
;
rc
->
bottom
+
=
b
;
}
}
}
}
...
@@ -189,14 +189,18 @@ inline std::vector<RECT> split_rect(LPCRECT rc, int n, int gap = 50) {
...
@@ -189,14 +189,18 @@ inline std::vector<RECT> split_rect(LPCRECT rc, int n, int gap = 50) {
return
v
;
return
v
;
};
};
// 将矩形水平平均分割为n份矩形
,间距为wgap
// 将矩形水平平均分割为n份矩形
, 当hgap==-1时,分割出的矩形与源矩形保持比例
inline
std
::
vector
<
RECT
>
split_rect_horizontal
(
LPCRECT
rc
,
int
n
,
int
wgap
=
50
)
{
inline
std
::
vector
<
RECT
>
split_rect_horizontal
(
LPCRECT
rc
,
int
n
,
int
wgap
=
50
,
int
hgap
=
-
1
)
{
using
namespace
detail
;
using
namespace
detail
;
std
::
vector
<
RECT
>
v
;
std
::
vector
<
RECT
>
v
;
double
ratio
=
(
rc
->
right
-
rc
->
left
)
*
1
.
0
/
(
rc
->
bottom
-
rc
->
top
);
int
w
=
(
Width
(
rc
)
-
(
n
+
1
)
*
wgap
)
/
n
;
int
w
=
(
Width
(
rc
)
-
(
n
+
1
)
*
wgap
)
/
n
;
int
h
=
static_cast
<
int
>
(
w
/
ratio
);
int
hgap
=
(
Height
(
rc
)
-
h
)
/
2
;
if
(
hgap
==
-
1
)
{
double
ratio
=
(
rc
->
right
-
rc
->
left
)
*
1
.
0
/
(
rc
->
bottom
-
rc
->
top
);
int
h
=
static_cast
<
int
>
(
w
/
ratio
);
hgap
=
(
Height
(
rc
)
-
h
)
/
2
;
}
for
(
int
i
=
0
;
i
<
n
;
i
++
)
{
for
(
int
i
=
0
;
i
<
n
;
i
++
)
{
RECT
r
=
*
rc
;
RECT
r
=
*
rc
;
...
...
This diff is collapsed.
Click to expand it.
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