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
e30a886f
Commit
e30a886f
authored
Jan 17, 2017
by
Alexey.Musinov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
native fix
parent
c488fae3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
144 deletions
+2
-144
common/Drawings/Format/Path.js
common/Drawings/Format/Path.js
+2
-2
common/Native/Wrappers/api.js
common/Native/Wrappers/api.js
+0
-142
No files found.
common/Drawings/Format/Path.js
View file @
e30a886f
...
...
@@ -1168,7 +1168,7 @@ Path.prototype = {
if
(
!
isLine
)
isRect
=
this
.
isSmartRect
();
if
(
!
isLine
&&
!
isRect
)
if
(
window
[
"
NATIVE_EDITOR_ENJINE
"
]
||
(
!
isLine
&&
!
isRect
)
)
return
this
.
draw
(
shape_drawer
);
var
_old_int
=
_graphics
.
m_bIntegerGrid
;
...
...
@@ -1872,7 +1872,7 @@ Path.prototype = {
if
(
!
isLine
)
isRect
=
this
.
isSmartRect
();
if
(
!
isLine
&&
!
isRect
)
if
(
window
[
"
NATIVE_EDITOR_ENJINE
"
]
||
(
!
isLine
&&
!
isRect
)
)
return
this
.
draw
(
shape_drawer
);
var
_old_int
=
_graphics
.
m_bIntegerGrid
;
...
...
common/Native/Wrappers/api.js
View file @
e30a886f
...
...
@@ -238,148 +238,6 @@ Asc['asc_docs_api'].prototype.GenerateNativeStyles = function()
StylesPainter
.
GenerateStyles
(
this
,
this
.
LoadedObjectDS
);
};
window
[
'
AscFormat
'
].
Path
.
prototype
.
drawSmart
=
function
(
shape_drawer
)
{
var
_graphics
=
shape_drawer
.
Graphics
;
var
_full_trans
=
_graphics
.
m_oFullTransform
;
if
(
!
_graphics
||
!
_full_trans
||
undefined
==
_graphics
.
m_bIntegerGrid
||
true
===
shape_drawer
.
bIsNoSmartAttack
)
return
this
.
draw
(
shape_drawer
);
var
bIsTransformed
=
(
_full_trans
.
shx
==
0
&&
_full_trans
.
shy
==
0
)
?
false
:
true
;
if
(
bIsTransformed
)
return
this
.
draw
(
shape_drawer
);
var
isLine
=
this
.
isSmartLine
();
var
isRect
=
false
;
if
(
!
isLine
)
isRect
=
this
.
isSmartRect
();
//if (!isLine && !isRect) // IOS убрать
return
this
.
draw
(
shape_drawer
);
var
_old_int
=
_graphics
.
m_bIntegerGrid
;
if
(
false
==
_old_int
)
_graphics
.
SetIntegerGrid
(
true
);
var
dKoefMMToPx
=
Math
.
max
(
_graphics
.
m_oCoordTransform
.
sx
,
0.001
);
var
_ctx
=
_graphics
.
m_oContext
;
var
bIsStroke
=
(
shape_drawer
.
bIsNoStrokeAttack
||
(
this
.
stroke
!==
true
))
?
false
:
true
;
var
bIsEven
=
false
;
if
(
bIsStroke
)
{
var
_lineWidth
=
Math
.
max
((
shape_drawer
.
StrokeWidth
*
dKoefMMToPx
+
0.5
)
>>
0
,
1
);
_ctx
.
lineWidth
=
_lineWidth
;
if
(
_lineWidth
&
0x01
==
0x01
)
bIsEven
=
true
;
}
var
bIsDrawLast
=
false
;
var
path
=
this
.
ArrPathCommand
;
shape_drawer
.
_s
();
if
(
!
isRect
)
{
for
(
var
j
=
0
,
l
=
path
.
length
;
j
<
l
;
++
j
)
{
var
cmd
=
path
[
j
];
switch
(
cmd
.
id
)
{
case
AscFormat
.
moveTo
:
{
bIsDrawLast
=
true
;
var
_x
=
(
_full_trans
.
TransformPointX
(
cmd
.
X
,
cmd
.
Y
))
>>
0
;
var
_y
=
(
_full_trans
.
TransformPointY
(
cmd
.
X
,
cmd
.
Y
))
>>
0
;
if
(
bIsEven
)
{
_x
-=
0.5
;
_y
-=
0.5
;
}
_ctx
.
moveTo
(
_x
,
_y
);
break
;
}
case
AscFormat
.
lineTo
:
{
bIsDrawLast
=
true
;
var
_x
=
(
_full_trans
.
TransformPointX
(
cmd
.
X
,
cmd
.
Y
))
>>
0
;
var
_y
=
(
_full_trans
.
TransformPointY
(
cmd
.
X
,
cmd
.
Y
))
>>
0
;
if
(
bIsEven
)
{
_x
-=
0.5
;
_y
-=
0.5
;
}
_ctx
.
lineTo
(
_x
,
_y
);
break
;
}
case
AscFormat
.
close
:
{
_ctx
.
closePath
();
break
;
}
}
}
}
else
{
var
minX
=
100000
;
var
minY
=
100000
;
var
maxX
=
-
100000
;
var
maxY
=
-
100000
;
bIsDrawLast
=
true
;
for
(
var
j
=
0
,
l
=
path
.
length
;
j
<
l
;
++
j
)
{
var
cmd
=
path
[
j
];
switch
(
cmd
.
id
)
{
case
AscFormat
.
moveTo
:
case
AscFormat
.
lineTo
:
{
if
(
minX
>
cmd
.
X
)
minX
=
cmd
.
X
;
if
(
minY
>
cmd
.
Y
)
minY
=
cmd
.
Y
;
if
(
maxX
<
cmd
.
X
)
maxX
=
cmd
.
X
;
if
(
maxY
<
cmd
.
Y
)
maxY
=
cmd
.
Y
;
break
;
}
default
:
break
;
}
}
var
_x1
=
(
_full_trans
.
TransformPointX
(
minX
,
minY
))
>>
0
;
var
_y1
=
(
_full_trans
.
TransformPointY
(
minX
,
minY
))
>>
0
;
var
_x2
=
(
_full_trans
.
TransformPointX
(
maxX
,
maxY
))
>>
0
;
var
_y2
=
(
_full_trans
.
TransformPointY
(
maxX
,
maxY
))
>>
0
;
if
(
bIsEven
)
_ctx
.
rect
(
_x1
+
0.5
,
_y1
+
0.5
,
_x2
-
_x1
,
_y2
-
_y1
);
else
_ctx
.
rect
(
_x1
,
_y1
,
_x2
-
_x1
,
_y2
-
_y1
);
}
if
(
bIsDrawLast
)
{
shape_drawer
.
drawFillStroke
(
true
,
this
.
fill
,
bIsStroke
);
}
shape_drawer
.
_e
();
if
(
false
==
_old_int
)
_graphics
.
SetIntegerGrid
(
false
);
};
// TEXTFONTFAMILY
function
asc_menu_ReadFontFamily
(
_params
,
_cursor
)
{
...
...
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