git.ucc.asn.au
/
ipdf
/
code.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
QuadTree Rendering with GPU coord transform.
[ipdf/code.git]
/
src
/
quadtree.cpp
diff --git
a/src/quadtree.cpp
b/src/quadtree.cpp
index
a4e0df2
..
9ba2cee
100644
(file)
--- a/
src/quadtree.cpp
+++ b/
src/quadtree.cpp
@@
-5,36
+5,36
@@
namespace IPDF {
Rect TransformToQuadChild(const Rect& src, QuadTreeNodeChildren child_type)
{
Rect TransformToQuadChild(const Rect& src, QuadTreeNodeChildren child_type)
{
- Rect dst;
+ Rect dst
= src
;
dst.x *= 2;
dst.y *= 2;
dst.w *= 2;
dst.h *= 2;
if (child_type == QTC_BOTTOM_LEFT || child_type == QTC_BOTTOM_RIGHT)
{
dst.x *= 2;
dst.y *= 2;
dst.w *= 2;
dst.h *= 2;
if (child_type == QTC_BOTTOM_LEFT || child_type == QTC_BOTTOM_RIGHT)
{
- dst.x -=
2
;
+ dst.x -=
1
;
}
if (child_type == QTC_TOP_RIGHT || child_type == QTC_BOTTOM_RIGHT)
{
}
if (child_type == QTC_TOP_RIGHT || child_type == QTC_BOTTOM_RIGHT)
{
- dst.y -=
2
;
+ dst.y -=
1
;
}
return dst;
}
Rect TransformFromQuadChild(const Rect& src, QuadTreeNodeChildren child_type)
{
}
return dst;
}
Rect TransformFromQuadChild(const Rect& src, QuadTreeNodeChildren child_type)
{
- Rect dst;
+ Rect dst
= src
;
dst.x *= 0.5;
dst.y *= 0.5;
dst.w *= 0.5;
dst.h *= 0.5;
if (child_type == QTC_BOTTOM_LEFT || child_type == QTC_BOTTOM_RIGHT)
{
dst.x *= 0.5;
dst.y *= 0.5;
dst.w *= 0.5;
dst.h *= 0.5;
if (child_type == QTC_BOTTOM_LEFT || child_type == QTC_BOTTOM_RIGHT)
{
- dst.x +=
0.5
;
+ dst.x +=
1
;
}
if (child_type == QTC_TOP_RIGHT || child_type == QTC_BOTTOM_RIGHT)
{
}
if (child_type == QTC_TOP_RIGHT || child_type == QTC_BOTTOM_RIGHT)
{
- dst.y +=
0.5
;
+ dst.y +=
1
;
}
return dst;
}
}
return dst;
}
UCC
git Repository :: git.ucc.asn.au