Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sdkjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
sdkjs
Commits
fb6753d3
Commit
fb6753d3
authored
May 13, 2016
by
Oleg Korshul
Committed by
Alexander.Trofimov
May 19, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
flip bug
parent
2133a8c1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
3 deletions
+63
-3
common/Drawings/Metafile.js
common/Drawings/Metafile.js
+54
-0
word/Drawing/ShapeDrawer.js
word/Drawing/ShapeDrawer.js
+9
-3
No files found.
common/Drawings/Metafile.js
View file @
fb6753d3
...
@@ -2397,6 +2397,59 @@ CMatrix.prototype =
...
@@ -2397,6 +2397,59 @@ CMatrix.prototype =
}
}
};
};
function
GradientGetAngleNoRotate
(
_angle
,
_transform
)
{
var
x1
=
0.0
;
var
y1
=
0.0
;
var
x2
=
1.0
;
var
y2
=
0.0
;
var
_matrixRotate
=
new
CMatrix
();
_matrixRotate
.
Rotate
(
-
_angle
/
60000
);
var
_x11
=
_matrixRotate
.
TransformPointX
(
x1
,
y1
);
var
_y11
=
_matrixRotate
.
TransformPointY
(
x1
,
y1
);
var
_x22
=
_matrixRotate
.
TransformPointX
(
x2
,
y2
);
var
_y22
=
_matrixRotate
.
TransformPointY
(
x2
,
y2
);
_matrixRotate
=
global_MatrixTransformer
.
Invert
(
_transform
);
var
_x1
=
_matrixRotate
.
TransformPointX
(
_x11
,
_y11
);
var
_y1
=
_matrixRotate
.
TransformPointY
(
_x11
,
_y11
);
var
_x2
=
_matrixRotate
.
TransformPointX
(
_x22
,
_y22
);
var
_y2
=
_matrixRotate
.
TransformPointY
(
_x22
,
_y22
);
var
_y
=
_y2
-
_y1
;
var
_x
=
_x2
-
_x1
;
var
a
=
0
;
if
(
Math
.
abs
(
_y
)
<
0.001
)
{
if
(
_x
>
0
)
a
=
0
;
else
a
=
180
;
}
else
if
(
Math
.
abs
(
_x
)
<
0.001
)
{
if
(
_y
>
0
)
a
=
90
;
else
a
=
270
;
}
else
{
a
=
Math
.
atan2
(
_y
,
_x
);
a
=
rad2deg
(
a
);
}
if
(
a
<
0
)
a
+=
360
;
console
.
log
(
a
);
return
a
*
60000
;
};
var
CMatrixL
=
CMatrix
;
var
CMatrixL
=
CMatrix
;
function
CGlobalMatrixTransformer
()
function
CGlobalMatrixTransformer
()
...
@@ -2803,4 +2856,5 @@ var CMatrixL = CMatrix;
...
@@ -2803,4 +2856,5 @@ var CMatrixL = CMatrix;
window
[
'
AscCommon
'
].
g_dDpiX
=
g_dDpiX
;
window
[
'
AscCommon
'
].
g_dDpiX
=
g_dDpiX
;
window
[
'
AscCommon
'
].
g_dKoef_mm_to_pix
=
g_dKoef_mm_to_pix
;
window
[
'
AscCommon
'
].
g_dKoef_mm_to_pix
=
g_dKoef_mm_to_pix
;
window
[
'
AscCommon
'
].
g_dKoef_pix_to_mm
=
g_dKoef_pix_to_mm
;
window
[
'
AscCommon
'
].
g_dKoef_pix_to_mm
=
g_dKoef_pix_to_mm
;
window
[
'
AscCommon
'
].
GradientGetAngleNoRotate
=
GradientGetAngleNoRotate
;
})(
window
);
})(
window
);
word/Drawing/ShapeDrawer.js
View file @
fb6753d3
...
@@ -1060,9 +1060,14 @@ CShapeDrawer.prototype =
...
@@ -1060,9 +1060,14 @@ CShapeDrawer.prototype =
if
(
_fill
.
lin
)
if
(
_fill
.
lin
)
{
{
var
_angle
=
_fill
.
lin
.
angle
;
var
_angle
=
_fill
.
lin
.
angle
;
if
(
_fill
.
rotateWithShape
===
false
&&
this
.
Graphics
.
m_oTransform
)
if
(
_fill
.
rotateWithShape
===
false
)
{
{
_angle
-=
(
60000
*
this
.
Graphics
.
m_oTransform
.
GetRotation
());
var
matrix_transform
=
(
this
.
Graphics
.
IsTrack
===
true
)
?
this
.
Graphics
.
Graphics
.
m_oTransform
:
this
.
Graphics
.
m_oTransform
;
if
(
matrix_transform
)
{
//_angle -= (60000 * this.Graphics.m_oTransform.GetRotation());
_angle
=
AscCommon
.
GradientGetAngleNoRotate
(
_angle
,
matrix_transform
);
}
}
}
var
points
=
this
.
getGradientPoints
(
this
.
min_x
,
this
.
min_y
,
this
.
max_x
,
this
.
max_y
,
_angle
,
_fill
.
lin
.
scale
);
var
points
=
this
.
getGradientPoints
(
this
.
min_x
,
this
.
min_y
,
this
.
max_x
,
this
.
max_y
,
_angle
,
_fill
.
lin
.
scale
);
...
@@ -1417,7 +1422,8 @@ CShapeDrawer.prototype =
...
@@ -1417,7 +1422,8 @@ CShapeDrawer.prototype =
var
_angle
=
_fill
.
lin
.
angle
;
var
_angle
=
_fill
.
lin
.
angle
;
if
(
_fill
.
rotateWithShape
===
false
&&
this
.
Graphics
.
m_oTransform
)
if
(
_fill
.
rotateWithShape
===
false
&&
this
.
Graphics
.
m_oTransform
)
{
{
_angle
-=
(
60000
*
this
.
Graphics
.
m_oTransform
.
GetRotation
());
//_angle -= (60000 * this.Graphics.m_oTransform.GetRotation());
_angle
=
AscCommon
.
GradientGetAngleNoRotate
(
_angle
,
this
.
Graphics
.
m_oTransform
);
}
}
points
=
this
.
getGradientPoints
(
this
.
min_x
,
this
.
min_y
,
this
.
max_x
,
this
.
max_y
,
_angle
,
_fill
.
lin
.
scale
);
points
=
this
.
getGradientPoints
(
this
.
min_x
,
this
.
min_y
,
this
.
max_x
,
this
.
max_y
,
_angle
,
_fill
.
lin
.
scale
);
...
...
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