Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/draw #4252

Open
wants to merge 285 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
285 commits
Select commit Hold shift + click to select a range
87a5e94
[ve] Add validation xml class + sax-serialize comment
fedek1324 Sep 11, 2023
2713a05
[ve] Add solution classes, all tests pass but sometimes fail beacause…
fedek1324 Sep 13, 2023
7eb1f4e
[ve] Add drawing test with canvas
konovalovsergey Sep 13, 2023
2e8211f
[ve] Add api for work with xml classes with function addSquarePolygon
fedek1324 Sep 13, 2023
403b13e
[draw] fix drawing
SergeyLuzyanin Sep 13, 2023
593d204
[ve] Try to draw figure from file, not finished
fedek1324 Sep 18, 2023
ebd9392
[ve] Draw rectangle + add triangle test file
fedek1324 Sep 18, 2023
2ffaf7b
[ve] Remove stubs when comparing xml strings
konovalovsergey Sep 19, 2023
e1f796a
[ve] Change generated files quotes to single + remove ignoreQuotes an…
fedek1324 Sep 19, 2023
85c1d2c
[ve] Try draw triangle (not finished)
fedek1324 Sep 19, 2023
1d7a489
[ve] Add license to test-files.js
fedek1324 Sep 19, 2023
508356d
[ve] Fix triangle draw + refact
fedek1324 Sep 19, 2023
7ae0bf7
[ve] Fix drawing of test file(in inch)(page size, units, logic coords)
konovalovsergey Sep 22, 2023
13f4ea0
[ve] Add commands instead of points + js doc
fedek1324 Sep 23, 2023
b204b24
[ve] Fix regular shapes draw + add eliptic arc mock
fedek1324 Sep 25, 2023
a151044
[ve] Add ElipticArc draw with 0 elipse angle + remove mirror vertically
fedek1324 Sep 26, 2023
2752839
[ve] Add visio document api file for correct master use + fix shape c…
fedek1324 Sep 27, 2023
e8e37c9
[ve] Move api to fix previous commit
fedek1324 Sep 28, 2023
6149c93
[ve] Add corrdect Y axis draw - fliped Y axis
fedek1324 Sep 29, 2023
2bf2ce5
[ve] Flip graphics y inshead of shapes y
fedek1324 Oct 4, 2023
3272e66
[ve] Set correct elliptic arc draw with 0 angle + add end point calc …
fedek1324 Oct 5, 2023
e59e2e1
[ve] Fix drag and drop, reflect and shape size
konovalovsergey Oct 9, 2023
8fb7b6c
[ve] Try to rotate arc consider ellipseRotation - error: no figure
fedek1324 Oct 9, 2023
abb65f8
[ve] Add flip + del attribute check
fedek1324 Oct 9, 2023
4a4718d
[ve] Remove arc rotate stub. error: no figure
fedek1324 Oct 9, 2023
33b35b1
[ve] Add comments
fedek1324 Oct 9, 2023
c2211af
[ve] Change Path.draw arcTo arguments. Should draw arc now
fedek1324 Oct 10, 2023
6adb46d
[ve] Chage figma links
fedek1324 Oct 10, 2023
998a387
[ve] Add cord transform. transformEllipticalArcParams return anti-clo…
fedek1324 Oct 11, 2023
8d8a946
[ve] Add ellipticalArcTo Path command
fedek1324 Oct 11, 2023
df9898d
[ve] Return Ellipse draw + format
fedek1324 Oct 12, 2023
ee66844
[ve] Change get-geometry-from-class file structure + change parseInt …
fedek1324 Oct 12, 2023
4b87422
[ve] Add ArcTo visio command draw + new test files
fedek1324 Oct 12, 2023
e96c33c
[ve] Remove bug: forgot break; + add explicit types convertion
fedek1324 Oct 12, 2023
adf1278
[ve] Fix ArcTo
fedek1324 Oct 13, 2023
05a3994
[ve] Fix findObjects + handle multiple Geometry sections using Path o…
fedek1324 Oct 13, 2023
8ab1b02
[ve] Remove path.close() + new Ellipse end point
fedek1324 Oct 13, 2023
ae7e88f
[ve] Fix NoFill init
fedek1324 Oct 16, 2023
138f084
[ve] Add rotation (not checking rotation point)
fedek1324 Oct 16, 2023
8bdacb9
[ve] Add dropped file save
fedek1324 Oct 16, 2023
d281215
[ve] Use base64 for file save
fedek1324 Oct 17, 2023
77fa262
[ve] Parse visio NURBS params
fedek1324 Oct 20, 2023
be0ba88
[ve] Consider shape LocPinX LocPinY
fedek1324 Oct 23, 2023
98e1928
[ve] Add NURBS draw using de Boor's algorithm
fedek1324 Oct 23, 2023
c45df7a
[ve] Add NURBS draw using to Bezier convert i.e. using Boehm's algorithm
fedek1324 Oct 25, 2023
9ed1ef1
[ve] Use Reflect and TransformAppend to flip Y and move coordinate sy…
fedek1324 Oct 25, 2023
8a127fd
[ve] Add Path.nurbsTo command
fedek1324 Oct 25, 2023
a1d19b3
[ve] RelCubBezTo draw realize + Add NoShow visio attribute handle
fedek1324 Oct 29, 2023
7e4b5b4
[ve] RelEllipticalArcTo draw realize
fedek1324 Oct 29, 2023
f895a4c
[ve] Improove master to shape inheritance
fedek1324 Oct 30, 2023
424729d
[ve] new Path.js nurbsTo arguments
fedek1324 Oct 31, 2023
f80043c
[ve] Add SplineStart and SplineKnot visio command handle
fedek1324 Oct 31, 2023
3421f76
[ve] Add PolylineTo draw
fedek1324 Nov 1, 2023
8ff40a6
[ve] Add PolylineTo lastPoint + InfiniteLine draw
fedek1324 Nov 1, 2023
c477b03
[ve] Add RelQuadBezTo draw
fedek1324 Nov 1, 2023
b3a9486
[ve] Fix Spline draw bug
fedek1324 Nov 2, 2023
1eab58c
[ve] Add caution messages to Path.js + add 2 degree NURBS draw
fedek1324 Nov 3, 2023
8be438a
[ve] Add nth degree Bezier draw
fedek1324 Nov 6, 2023
d05cfb7
[ve] Use path length to calculate interpolate points count for nth or…
fedek1324 Nov 7, 2023
1f1eb92
[ve] Fix bugs in drawNthDegreeBezier interpolationPointsCount
fedek1324 Nov 10, 2023
652e5f5
[ve] Add new comments to drawNthDegreeBezier
fedek1324 Nov 14, 2023
53d24a2
[ve] Add zoom
fedek1324 Nov 15, 2023
f0f1ffe
[ve] Fix multiple ellipse draw in one shape bug + comments change
fedek1324 Nov 16, 2023
a82648e
[ve] Fix ellipse draw using Ellipse command + add stub for rotated el…
fedek1324 Nov 17, 2023
9334e48
[ve] Add recursive subshapes read
fedek1324 Nov 24, 2023
c6da13c
[ve] Call inhetirance recursive
fedek1324 Nov 24, 2023
bae4fd3
[ve] Move collectSubshapesRecursive() + check pinX pinY, noShowCell e…
fedek1324 Nov 28, 2023
0de08e2
[ve] Move comments to inheritance function
fedek1324 Nov 30, 2023
1534b4d
[ve] Add getCell(s), getRow(s), getSection(s), getElements, functions…
fedek1324 Nov 30, 2023
4ff122f
[ve] Add variationClrSchemeLst theme tag handle (variation Colors)
fedek1324 Dec 6, 2023
f96312c
Add Array.find polyfill
fedek1324 Dec 7, 2023
465a88c
[ve] Add style inheritance
fedek1324 Dec 7, 2023
33c5798
Add Array.prototype.reduce polyfill
fedek1324 Dec 16, 2023
334bdc8
[ve] Add fill color for the most simple cases. Wrong color sometimes
fedek1324 Dec 16, 2023
0b7763a
[ve] Fix calculateUniFill
konovalovsergey Dec 18, 2023
347585c
[ve] Apply QuickStyleFillMatrix modifiers
konovalovsergey Dec 18, 2023
f0142d6
[ve] Apply FillPattern fill
konovalovsergey Dec 18, 2023
e1610e5
[ve] Generate DefaultTheme in case of absence
konovalovsergey Dec 19, 2023
e8ff3f8
[ve] Use AscCommon.RgbaHexToRGBA instead of getRgbColor; Fix constant…
konovalovsergey Dec 20, 2023
3bdd2f8
[ve] Code comment
fedek1324 Dec 21, 2023
0c028f5
[ve] Refactor clrScheme extList parse and use
fedek1324 Dec 21, 2023
9b2e423
[ve] Rename visio theme extension classes
fedek1324 Dec 22, 2023
f163710
[ve] Remove CVariationClrSchemeLst class which is not need now
fedek1324 Dec 23, 2023
8508b52
[ve] Add theme fontScheme extension parse (schemeEnum value only)
fedek1324 Dec 23, 2023
0146c1a
[ve] Nonexistant method was used in spline draw
fedek1324 Dec 23, 2023
96aa4b8
[ve] Finish CClrSchemeExtLst
fedek1324 Dec 23, 2023
d970e81
[ve] Add themeScheme, fmtSchemeEx, fmtConnectorSchemeEx theme extensi…
fedek1324 Dec 23, 2023
fe3c994
[ve] Fix bug when no theme.xml file
fedek1324 Dec 23, 2023
52b284f
[ve] Add comments
fedek1324 Dec 24, 2023
f865f63
Copy polyfills from develop branch
fedek1324 Dec 25, 2023
3a29383
[ve] Unite paths with fill true to one path object
fedek1324 Dec 25, 2023
d60cfc0
[ve] Try to get line border color, get black color usually
fedek1324 Dec 26, 2023
7d25aef
[ve] Fix no theme bug on colors recalculate
fedek1324 Dec 27, 2023
eee66a9
[ve] Add no line stroke case handle
fedek1324 Dec 27, 2023
984ff9f
[ve] Add stroke width calculation
fedek1324 Dec 27, 2023
5ab142f
[ve] Add hotfixes
fedek1324 Dec 27, 2023
7c27e72
[ve] Move draw-file.html and draw-file.js
fedek1324 Jan 6, 2024
5f9913e
[ve] Move api to sdkjs
fedek1324 Jan 9, 2024
7718637
[ve] Calculate LineWeight separate from LinePattern and LineColor
fedek1324 Jan 11, 2024
8d2e1dc
[ve] Add QuickStyleVariation line color handle
fedek1324 Jan 11, 2024
b652bae
[ve] Move code to themeval function + finish QuickStyleVariation hand…
fedek1324 Jan 12, 2024
e21305f
[ve] Add line (stroke) color hotfix on recalculatePen
fedek1324 Jan 16, 2024
ecd16df
[ve] Add new comments about recalculate fix
fedek1324 Jan 16, 2024
022e94f
[ve] Fix default values
fedek1324 Jan 16, 2024
ffd19a9
[ve] Add style inheritance when line style, fill style and text style…
fedek1324 Jan 17, 2024
51ad443
[ve] Move convert to shape function + add fill transparency
fedek1324 Jan 18, 2024
adaab40
[ve] Fix zoom (some files didnt show) + add console log about foreign…
fedek1324 Jan 19, 2024
3d53943
[ve] Add shape FlipX FlipY cells handle
fedek1324 Jan 19, 2024
c21ee82
[ve] Add groups (may cause bad results - some element disappear)
fedek1324 Jan 23, 2024
cc4c3fd
[ve] Add small fix (doesnt fix all)
fedek1324 Jan 23, 2024
7c33cd6
[ve] Add group geometry view fixes
fedek1324 Jan 24, 2024
3b15510
[ve] Move convertToCGroupRecursively() to Shape_Type class
fedek1324 Jan 24, 2024
62d6c6c
[ve] Set no terminate if shape with no appear PinX or PinY on group h…
fedek1324 Jan 25, 2024
01c6f1c
[ve] Add multiple themes parse
fedek1324 Jan 25, 2024
b0cae51
[ve] Try add text
fedek1324 Jan 30, 2024
a8c7595
[draw] Load font for before calculating document, use CShape draw method
SergeyLuzyanin Jan 31, 2024
a45dde9
[ve] Use CEditorPage from presentation
konovalovsergey Jan 31, 2024
60e2299
Add GetApi, GetDrawingDocument to mock logic document
SergeyLuzyanin Jan 31, 2024
1d49208
[ve] Add text read
fedek1324 Jan 31, 2024
dc8b95b
[ve] Try to align all text to center of shapes
fedek1324 Feb 2, 2024
4b42182
[ve] Try to set shape text horizontally and vertically centered 2 (ca…
fedek1324 Feb 2, 2024
aae6a0e
[ve] Try to set shape text vertically and horizontally centered 3: mi…
fedek1324 Feb 5, 2024
007f830
[draw] fix the problem with compiled styles in paragraphs
SergeyLuzyanin Feb 6, 2024
68fa686
[ve] Add text color view (todo color variation cell) so add fontStyle…
fedek1324 Feb 8, 2024
9bd0464
[ve] Add color fixes + refactor
fedek1324 Feb 10, 2024
ad654cb
[ve] Move functions to convertFunctions.js
fedek1324 Feb 12, 2024
9004344
[ve] Add text props inheritance from StyleSheets (fixes color) + add …
fedek1324 Feb 14, 2024
fcc9e6e
[ve] Change fill pattern type handle
fedek1324 Feb 15, 2024
55aa206
[ve] Add group text
fedek1324 Feb 19, 2024
eec0e11
[ve] Add asc_docs_api.asc_nativeGetPDF to print vsdx
konovalovsergey Feb 19, 2024
3f7eb95
Merge branch 'develop' into feature/draw
konovalovsergey Feb 19, 2024
b8f1aea
[ve] Fix after merge
konovalovsergey Feb 19, 2024
f116dc3
[ve] Fix no gemetry shapes handle
fedek1324 Feb 21, 2024
aa95a45
[ve] Try to handle text position. Text block height and width unhandled
fedek1324 Feb 26, 2024
1ae906d
[ve] Return getParentObject overrides
fedek1324 Feb 29, 2024
fd4b3e0
[ve] Change overrides.js import order
fedek1324 Feb 29, 2024
aa430c3
[ve] Add shape recalculate override
fedek1324 Feb 29, 2024
23856b7
[ve] Use CShapes for text
fedek1324 Mar 1, 2024
2f93a07
[ve] Add font size and vertical align handle
fedek1324 Mar 4, 2024
5f21e60
[draw] fix drawing text
SergeyLuzyanin Mar 6, 2024
1427d1b
[ve] Add paragraphs Jc read (horizonral text align)
fedek1324 Mar 7, 2024
22f1d16
[ve] Add fld_Type (text field) text read
fedek1324 Mar 7, 2024
d21eceb
[ve] Fix default text color + add text insets handle
fedek1324 Mar 11, 2024
2210273
[ve] Add correct scroll lines for drawings
fedek1324 Mar 11, 2024
408a5e1
[ve] Set Calibri as default font + add visio document fonts load
fedek1324 Mar 12, 2024
c20508d
[ve] Add style inheritance optimization
fedek1324 Mar 12, 2024
d8151ca
[ve] Try to fix common_check / builder-tests
fedek1324 Mar 13, 2024
b431167
[ve] Add document fonts use
fedek1324 Mar 15, 2024
a96d7bb
[ve] Add text block cords handle on shape flip
fedek1324 Mar 18, 2024
962bf41
[ve] Add fit page to window zoom
fedek1324 Mar 20, 2024
98459a5
[ve] Add read cp row 0 and pp row 0 by default
fedek1324 Mar 21, 2024
008fe67
[ve] Add multiple themes handle
fedek1324 Mar 22, 2024
43155b4
[ve] Improove colors: use ColorSchemeIndex, color.calculate(theme), 6…
fedek1324 Mar 25, 2024
05ae0d7
[ve] Add connector styles handle
fedek1324 Mar 26, 2024
79bab8f
[ve] Impoove colors: handle quickStyleVariation only if themeVal is used
fedek1324 Mar 28, 2024
de38cb8
Merge branch 'develop' into feature/draw
konovalovsergey Mar 29, 2024
1867e97
fix after merge
SergeyLuzyanin Mar 29, 2024
ab02232
[ve] After merge
konovalovsergey Mar 29, 2024
d67c110
Fix typo
K0R0L Mar 29, 2024
f6257f7
Refactoring & support BaseTransform for graphics
K0R0L Mar 29, 2024
39768b3
[ve] Fix asc_nativePrint
konovalovsergey Mar 29, 2024
52a938b
[ve] For prev commit
konovalovsergey Mar 29, 2024
aaf60ee
Merge branch 'release/v8.1.0' into feature/draw
K0R0L Mar 29, 2024
780cd6e
Refactoring working with base matrix
K0R0L Mar 29, 2024
b575da8
[ve] Move drawNthDegreeBezier
fedek1324 Apr 1, 2024
26e7450
[ve] Rename drawNthDegreeBezier to _cN and use its new version in CGr…
fedek1324 Apr 2, 2024
984773e
[ve] Add one line text fix
fedek1324 Apr 9, 2024
a18a24e
Merge branch 'develop' into feature/draw
konovalovsergey Apr 10, 2024
02cd89d
[ve] Try draw images: use loadDataLinks
fedek1324 May 2, 2024
0e469e4
[ve] Check if foreign is image
fedek1324 May 2, 2024
d88e298
[ve] Add recalc on image shape
fedek1324 May 2, 2024
2a8ac26
[ve] Add api.asyncFontsDocumentEndLoaded/asyncImagesDocumentEndLoaded…
konovalovsergey May 3, 2024
75c4f06
[ve] Add fix on page autoreaload + remove image.recalculateText calls
fedek1324 May 4, 2024
22ab878
[ve] Try to fix text version 2 + add images flip
fedek1324 May 7, 2024
63200eb
[ve] Set isOpenOOXInBrowser before OpenDocumentFromZip
konovalovsergey May 14, 2024
3c85dfc
[ve] Add getCell methods inheritance
fedek1324 May 14, 2024
8eb3236
[ve] Add image inheritance but sometimes crashes on xmlParserContext.…
fedek1324 May 14, 2024
f99d21b
[ve] Rewrite clone using Object.create
fedek1324 May 15, 2024
0c7b947
[ve] Call sort once on mergeElementArrays optimization
fedek1324 May 15, 2024
1a6084d
Catch error on emf read
fedek1324 May 15, 2024
b4796e0
[ve] Add antiscale use, first version
fedek1324 May 15, 2024
eebee80
[ve] Rename to antiscale to scale
fedek1324 May 20, 2024
ce7608b
[ve] Rename lineWidthAntiScaled to lineWidthScaled
fedek1324 May 21, 2024
8ae00f9
[ve] Move ooxml methods to SheetElementsStorage class
fedek1324 May 21, 2024
7667382
[ve] Use object instead of array for SheetElementsStorage to increase…
fedek1324 May 23, 2024
f654aa0
[ve] Add shapes hide because of layer properties
fedek1324 May 23, 2024
62dad05
[ve] Add console log message about shape on unvisible layer
fedek1324 May 28, 2024
4e0cabe
[ve] Set object storage for Section_Type and Row_Type
fedek1324 May 28, 2024
8138da1
[ve] Remove clone use, remove unused functionality
fedek1324 May 29, 2024
bc1507a
[ve] Add gradientEnabled cell handle
fedek1324 May 31, 2024
1d8215f
[ve] Refactor using getCellNumberValue
fedek1324 May 31, 2024
c5ef7a0
[ve] Add FillGradient section handle
fedek1324 Jun 3, 2024
8fe2cf8
[ve] Refact themeval
fedek1324 Jun 4, 2024
452ba93
[ve] Add text scale fix (bad fix) + add radial gradient handle + add …
fedek1324 Jun 10, 2024
ddec62b
[ve] Set text fix disabled
fedek1324 Jun 11, 2024
433cb18
Merge branch 'develop' into feature/draw. Want to get new emf read
fedek1324 Jun 11, 2024
4797c77
[ve] Fix after merge. Remove sendColorThemes on asc_docs_api
fedek1324 Jun 11, 2024
43b6c60
[ve] Add arrow ends handle
fedek1324 Jun 16, 2024
7c7b977
[ve] Add full visio line types handle
fedek1324 Jun 17, 2024
f3efc59
[ve] Add themed linePattern handle
fedek1324 Jun 22, 2024
7129c98
[ve] Refactor calculateCellValue
fedek1324 Jun 22, 2024
767a48f
[ve] Add themed line weight handle
fedek1324 Jun 23, 2024
c66e0a1
[ve] Refactor fillGradientEnabled calculate
fedek1324 Jul 8, 2024
ac69016
[ve] Merge branch 'develop' into feature/draw. Maybe pictures are fixed
fedek1324 Jul 8, 2024
649d069
[ve] Update configs/draw.json
fedek1324 Jul 8, 2024
c59fd03
[ve] Refact gradient cells calculation - move Themed calculation to T…
fedek1324 Jul 9, 2024
57b063e
[ve] Check shape is deleted + comment
fedek1324 Jul 11, 2024
00d78df
[ve] Fix draw shapes: EllipticalArc bug + layers bug
fedek1324 Jul 12, 2024
fce1fb3
[ve] Fix draw bug: split moveTo and lnTo
fedek1324 Jul 15, 2024
836762e
[ve] Refactor ArcTo draw fix
fedek1324 Jul 15, 2024
052b8a5
[ve] Add lineStyles theme extension parse (for arrows)
fedek1324 Jul 17, 2024
80da4d8
[ve] Add themed endArrow handle
fedek1324 Jul 20, 2024
9f4a811
[ve] Remove some console.log commands
fedek1324 Jul 20, 2024
011cd7e
[ve] Add arrow end size handle (no new types for visio, using ooxml t…
fedek1324 Jul 20, 2024
db613c6
[ve] Set proper NoLine cell (no stroke) handle for one geometry secti…
fedek1324 Jul 20, 2024
043fd05
[ve] Set proper NoLine (no stroke) for path when all Geometry section…
fedek1324 Jul 20, 2024
638ebb0
[ve] Add filll pattern handlde (without themeval, using ooxml types, …
fedek1324 Jul 22, 2024
aa6045d
[ve] With unhandled argument themeval function return undefined
fedek1324 Jul 22, 2024
7b5567b
[ve] Remove unused code + rename variationStyleScheme to variationSty…
fedek1324 Jul 22, 2024
a60bc1f
[ve] Add themed fill pattern handle + fix fill pattern map + add hand…
fedek1324 Jul 23, 2024
a90bbdb
[ve] Add comment about unusual case - getLineEndStyle
fedek1324 Jul 23, 2024
9d06905
[ve] Add comments about refact
fedek1324 Jul 23, 2024
6cf4865
[ve] Add html that can switch pages
fedek1324 Jul 23, 2024
4a1e929
[ve] Add thumbnails (draw-file doesn't work, images bug appeared)
fedek1324 Jul 28, 2024
c975cb9
[ve] Calculate thumbnail size from canvas size
fedek1324 Jul 28, 2024
8c0e5c0
[ve] Add draw on canvas function
fedek1324 Jul 28, 2024
e2cdb9b
[ve] Fix images draw (return shape transform values after fix)
fedek1324 Jul 30, 2024
a8feb8a
[ve] Remove nonASCII character from variable name
fedek1324 Jul 30, 2024
9d939a0
[ve] Set themeval return default value for unknown lineColor result a…
fedek1324 Jul 30, 2024
66914e7
[ve] Add undefined values handle
fedek1324 Jul 31, 2024
5b0460f
[ve] Don't read file again on zoom + fix zoom on not first page + no …
fedek1324 Aug 1, 2024
d3326a5
[ve] Wrong file check + refact
fedek1324 Aug 1, 2024
64c91e0
[ve] Add vsdx size types and vsdxDimensionLine end type (sizes don't …
fedek1324 Aug 3, 2024
4e8b6db
[ve] Add thumbnails scroll
fedek1324 Aug 3, 2024
427db35
[ve] Override CShapeDrawer.ds() + add correct vsdx end arrow sizes
fedek1324 Aug 11, 2024
4923571
[ve] Add vsdx triangle type + remove key press log
fedek1324 Aug 12, 2024
9e88fd2
[ve] Add comments for text transform and arrow draw
fedek1324 Aug 26, 2024
2c0ac8c
[ve] Add comment about 0 DPI huge text fix
fedek1324 Sep 3, 2024
af87ec5
[ve] Add handle case when fixToScreen zoom is not used
fedek1324 Sep 3, 2024
fc72d22
[ve] Normalize shape size with drawingScale and pageScale
konovalovsergey Sep 9, 2024
9a08c2a
Merge branch 'feature/draw-page-scale' into feature/draw. Fix text on
fedek1324 Sep 10, 2024
9fa5e3e
[ve] Refactor so that scale is obvious
fedek1324 Sep 10, 2024
b78941d
[ve] Fix angled arrows on zoom
fedek1324 Sep 16, 2024
a34340c
[ve] Fix arrow wrong angle
fedek1324 Sep 16, 2024
2d27d50
[ve] Remove thumbs draw for debug
fedek1324 Sep 16, 2024
cb4a615
[ve] Fix big arrow crash on big zoom + return thumbs draw
fedek1324 Sep 17, 2024
44ce7ba
[ve] Fix arrow angle calculate (add x2 y2 orig recalculate)
fedek1324 Sep 19, 2024
3a642c3
[ve] Fix vsdx dimension line size
fedek1324 Sep 20, 2024
fb1f618
[ve] Fix vsdx arrow type
fedek1324 Sep 20, 2024
4bdfa77
[ve] Add new lineEnd types based on previous
fedek1324 Sep 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 29 additions & 2 deletions build/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ module.exports = function(grunt) {
this.word = null;
this.cell = null;
this.slide = null;
this.draw = null;

this.append(pathConfigs);
}
Expand Down Expand Up @@ -132,9 +133,10 @@ module.exports = function(grunt) {
appendOption.call(this, 'word');
appendOption.call(this, 'cell');
appendOption.call(this, 'slide');
appendOption.call(this, 'draw');
};
CConfig.prototype.valid = function () {
return this.externs && this.word && this.cell && this.slide;
return this.externs && this.word && this.cell && this.slide && this.draw;
};

function getExterns(config) {
Expand Down Expand Up @@ -176,6 +178,7 @@ module.exports = function(grunt) {
const word = path.join(deploy, 'word');
const cell = path.join(deploy, 'cell');
const slide = path.join(deploy, 'slide');
const draw = path.join(deploy, 'draw');

const level = grunt.option('level') || 'ADVANCED';
const formatting = grunt.option('formatting') || '';
Expand Down Expand Up @@ -236,6 +239,7 @@ module.exports = function(grunt) {
const configWord = configs.word['sdk'];
const configCell = configs.cell['sdk'];
const configSlide = configs.slide['sdk'];
const configDraw = configs.draw['sdk'];

const compilerArgs = getExterns(configs.externs);
if (formatting) {
Expand Down Expand Up @@ -301,6 +305,10 @@ module.exports = function(grunt) {
grunt.initConfig(getCompileConfig(getFilesMin(configSlide), getFilesAll(configSlide), 'sdk-all-min', 'sdk-all', 'slide', path.join(slide , '/')));
grunt.task.run('closure-compiler');
});
grunt.registerTask('compile-draw', 'Compile Draw SDK', function () {
grunt.initConfig(getCompileConfig(getFilesMin(configDraw), getFilesAll(configDraw), 'sdk-all-min', 'sdk-all', 'draw', path.join(draw , '/')));
grunt.task.run('closure-compiler');
});
grunt.registerTask('copy-maps', 'Copy maps from deploy to build', function() {
grunt.initConfig({
copy: {
Expand Down Expand Up @@ -351,6 +359,22 @@ module.exports = function(grunt) {
}
}
]
},
draw: {
files: [
{
expand: true,
cwd: draw,
src: [
'sdk-all-min.js.map',
'sdk-all.js.map',
],
dest: 'maps',
rename: function (dest, src) {
return path.join(dest , src.replace('sdk', 'draw'));
}
}
]
}
},
clean: {
Expand All @@ -365,13 +389,15 @@ module.exports = function(grunt) {
path.join(cell, 'sdk-all.js.map'),
path.join(slide, 'sdk-all-min.js.map'),
path.join(slide, 'sdk-all.js.map'),
path.join(draw, 'sdk-all-min.js.map'),
path.join(draw, 'sdk-all.js.map'),
]
}
}
});
grunt.task.run('copy', 'clean');
});
grunt.registerTask('compile-sdk', ['compile-word', 'compile-cell', 'compile-slide']);
grunt.registerTask('compile-sdk', ['compile-word', 'compile-cell', 'compile-slide', 'compile-draw']);
grunt.registerTask('clean-deploy', 'Clean deploy folder before deploying', function () {
grunt.initConfig({
clean: {
Expand Down Expand Up @@ -490,6 +516,7 @@ module.exports = function(grunt) {
writeScripts(configs.word['sdk'], 'word');
writeScripts(configs.cell['sdk'], 'cell');
writeScripts(configs.slide['sdk'], 'slide');
writeScripts(configs.draw['sdk'], 'draw');
});
const defaultTasks = ['clean-deploy', 'compile-sdk', 'copy-other'];
if (grunt.option('map')) {
Expand Down
3 changes: 3 additions & 0 deletions cell/model/DrawingObjects/Format/ShapePrototype.js
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,9 @@ CShape.prototype.recalcText = function()
this.recalcInfo.recalculateTransformText = true;
};

/**
* @memberof CShape
*/
CShape.prototype.recalculate = function ()
{
if(this.bDeleted)
Expand Down
97 changes: 82 additions & 15 deletions common/Drawings/ArcTo.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@
var HitInBezier4 = AscFormat.HitInBezier4;

// arcTo new version
function Arc3(ctx, fX, fY, fWidth, fHeight, fStartAngle, fSweepAngle)
function Arc3(ctx, fX, fY, fWidth, fHeight, fStartAngle, fSweepAngle, ellipseRotation)
{
// Params transform
var sin1 = Math.sin(fStartAngle);
var cos1 = Math.cos(fStartAngle);

Expand All @@ -49,11 +50,13 @@
var cx = fX - l * cos1;
var cy = fY - l * sin1;

Arc2(ctx, cx - fWidth, cy - fHeight, 2 * fWidth, 2 * fHeight, fStartAngle, fSweepAngle);
// ellipseRotation can be undefined in old version calls and it is passed down anyway
Arc2(ctx, cx - fWidth, cy - fHeight, 2 * fWidth, 2 * fHeight, fStartAngle, fSweepAngle, ellipseRotation);
}

function Arc2(ctx, fX, fY, fWidth, fHeight, fStartAngle, fSweepAngle)
function Arc2(ctx, fX, fY, fWidth, fHeight, fStartAngle, fSweepAngle, ellipseRotation)
{
// Calls Ellipse or EllipseArc
if (0 >= fWidth || 0 >= fHeight)
return;

Expand All @@ -74,6 +77,8 @@
var bClockDirection = false;
var fEndAngle = (2 * Math.PI) -(fSweepAngle + fStartAngle);
var fSrtAngle = (2 * Math.PI) - fStartAngle;
// by this moment we have endAngle( = fEndAngle) and startAngle( = fSrtAngle) clockwise

if( fSweepAngle > 0 )
bClockDirection = true;

Expand All @@ -83,12 +88,14 @@
}
else
{
EllipseArc(ctx, fX + fWidth / 2, fY + fHeight / 2, fWidth / 2, fHeight / 2, fSrtAngle, fEndAngle, bClockDirection);
EllipseArc(ctx, fX + fWidth / 2, fY + fHeight / 2, fWidth / 2, fHeight / 2, fSrtAngle, fEndAngle, bClockDirection, ellipseRotation);
}
}

function AngToEllPrm(fAngle, fXRad, fYRad)
{
// to ellipse parametric equation angle parameter - t
// https://www.mathopenref.com/coordparamellipse.html
return Math.atan2( Math.sin( fAngle ) / fYRad, Math.cos( fAngle ) / fXRad );
}

Expand All @@ -103,8 +110,9 @@
ctx._c(fX - fXRad * c_fKappa, fY - fYRad, fX - fXRad, fY - fYRad * c_fKappa, fX - fXRad, fY);
}

function EllipseArc(ctx, fX, fY, fXRad, fYRad, fAngle1, fAngle2, bClockDirection)
function EllipseArc(ctx, fX, fY, fXRad, fYRad, fAngle1, fAngle2, bClockDirection, ellipseRotation)
{
// If arc comes through 0 angle - splits one to two EllipseArc2 calls
while ( fAngle1 < 0 )
fAngle1 += (2 * Math.PI);

Expand All @@ -117,35 +125,45 @@
while ( fAngle2 >= (2 * Math.PI) )
fAngle2 -= (2 * Math.PI);

// fX = cx, fY = cy, fAngle1 = startAngle, fAngle2 = endAngle
// rotatePoint added later for ellipse rotation. it is arc start point.
// it is not used if ellipseRotation not used
let rotatePoint = {x : fX + fXRad * Math.cos( AngToEllPrm( fAngle1, fXRad, fYRad ) ),
y : fY + fYRad * Math.sin( AngToEllPrm( fAngle1, fXRad, fYRad ) )};
// let rotatePoint = {x : fX - fXRad, y : fY};
if ( !bClockDirection )
{
if ( fAngle1 <= fAngle2 )
EllipseArc2(ctx, fX, fY, fXRad, fYRad, fAngle1, fAngle2, false);
EllipseArc2(ctx, fX, fY, fXRad, fYRad, fAngle1, fAngle2, false, ellipseRotation, rotatePoint);
else
{
EllipseArc2(ctx, fX, fY, fXRad, fYRad, fAngle1, 2 * Math.PI, false);
EllipseArc2(ctx, fX, fY, fXRad, fYRad, 0, fAngle2, false);
// if arc comes through 0 angle - split it
EllipseArc2(ctx, fX, fY, fXRad, fYRad, fAngle1, 2 * Math.PI, false, ellipseRotation, rotatePoint);
EllipseArc2(ctx, fX, fY, fXRad, fYRad, 0, fAngle2, false, ellipseRotation, rotatePoint);
}
}
else
{
if ( fAngle1 >= fAngle2 )
EllipseArc2(ctx, fX, fY, fXRad, fYRad, fAngle1, fAngle2, true);
EllipseArc2(ctx, fX, fY, fXRad, fYRad, fAngle1, fAngle2, true, ellipseRotation, rotatePoint);
else
{
EllipseArc2(ctx, fX, fY, fXRad, fYRad, fAngle1, 0, true);
EllipseArc2(ctx, fX, fY, fXRad, fYRad, 2 * Math.PI, fAngle2, true);
// if arc comes through 0 angle - split it
EllipseArc2(ctx, fX, fY, fXRad, fYRad, fAngle1, 0, true, ellipseRotation, rotatePoint);
EllipseArc2(ctx, fX, fY, fXRad, fYRad, 2 * Math.PI, fAngle2, true, ellipseRotation, rotatePoint);
}
}
}

function EllipseArc2(ctx, fX, fY, fXRad, fYRad, dAngle1, dAngle2, bClockDirection)
function EllipseArc2(ctx, fX, fY, fXRad, fYRad, dAngle1, dAngle2, bClockDirection, ellipseRotation, rotatePoint)
{
// Splits calls to EllipseArc3 on each quadrant
var nFirstPointQuard = ((2 * dAngle1 / Math.PI) >> 0) + 1;
var nSecondPointQuard = ((2 * dAngle2 / Math.PI) >> 0) + 1;
nSecondPointQuard = Math.min( 4, Math.max( 1, nSecondPointQuard ) );
nFirstPointQuard = Math.min( 4, Math.max( 1, nFirstPointQuard ) );

// fX = cx, fY = cy, fAngle1 = startAngle, fAngle2 = endAngle
var fStartX = fX + fXRad * Math.cos( AngToEllPrm( dAngle1, fXRad, fYRad ) );
var fStartY = fY + fYRad * Math.sin( AngToEllPrm( dAngle1, fXRad, fYRad ) );

Expand All @@ -167,7 +185,7 @@
if ( !( nIndex == nFirstPointQuard ) )
dStartAngle = (nIndex - 1 ) * Math.PI / 2;

EndPoint = EllipseArc3(ctx, fX, fY, fXRad, fYRad, AngToEllPrm( dStartAngle, fXRad, fYRad ), AngToEllPrm( dEndAngle, fXRad, fYRad ), false);
EndPoint = EllipseArc3(ctx, fX, fY, fXRad, fYRad, AngToEllPrm( dStartAngle, fXRad, fYRad ), AngToEllPrm( dEndAngle, fXRad, fYRad ), false, ellipseRotation, rotatePoint);
}
}
else
Expand All @@ -183,32 +201,81 @@
else
dEndAngle = dAngle2;

EndPoint = EllipseArc3(ctx, fX, fY, fXRad, fYRad, AngToEllPrm( dStartAngle, fXRad, fYRad ), AngToEllPrm( dEndAngle, fXRad, fYRad ), false);
EndPoint = EllipseArc3(ctx, fX, fY, fXRad, fYRad, AngToEllPrm( dStartAngle, fXRad, fYRad ), AngToEllPrm( dEndAngle, fXRad, fYRad ), false, ellipseRotation, rotatePoint);
}
}
}

function EllipseArc3(ctx, fX, fY, fXRad, fYRad, dAngle1, dAngle2, bClockDirection)
function EllipseArc3(ctx, fX, fY, fXRad, fYRad, dAngle1, dAngle2, bClockDirection, ellipseRotation, rotatePoint)
{
// fX = cx, fY = cy, fAngle1 = startAngle after AngToEllPrm, fAngle2 = endAngle after AngToEllPrm

var fAlpha = Math.sin( dAngle2 - dAngle1 ) * ( Math.sqrt( 4.0 + 3.0 * Math.tan( (dAngle2 - dAngle1) / 2.0 ) * Math.tan( (dAngle2 - dAngle1) / 2.0 ) ) - 1.0 ) / 3.0;

var sin1 = Math.sin(dAngle1);
var cos1 = Math.cos(dAngle1);
var sin2 = Math.sin(dAngle2);
var cos2 = Math.cos(dAngle2);

// calculate start point
var fX1 = fX + fXRad * cos1;
var fY1 = fY + fYRad * sin1;

// calculate end point
var fX2 = fX + fXRad * cos2;
var fY2 = fY + fYRad * sin2;

// bezier control point 1
var fCX1 = fX1 - fAlpha * fXRad * sin1;
var fCY1 = fY1 + fAlpha * fYRad * cos1;

// bezier control point 2
var fCX2 = fX2 + fAlpha * fXRad * sin2;
var fCY2 = fY2 - fAlpha * fYRad * cos2;

if (ellipseRotation !== undefined) {
// https://www.figma.com/file/hs43oiAUyuoqFULVoJ5lyZ/EllipticArcConvert?type=design&node-id=265-2&mode=design&t=pla9h2OkZAde8Xim-0
// ellipseRotation = 0;
// TODO import
/**
* afin rotate clockwise
* @param {number} x
* @param {number} y
* @param {number} radiansRotateAngle radians Rotate AntiClockWise Angle. E.g. 30 degrees rotates does DOWN.
* @returns {{x: number, y: number}} point
*/
function rotatePointAroundCordsStartClockWise(x, y, radiansRotateAngle) {
let newX = x * Math.cos(radiansRotateAngle) + y * Math.sin(radiansRotateAngle);
let newY = x * (-1) * Math.sin(radiansRotateAngle) + y * Math.cos(radiansRotateAngle);
return {x : newX, y: newY};
}

let startPointRelative = {x : fX1 - rotatePoint.x, y : rotatePoint.y - fY1};
let endPointRelative = {x : fX2 - rotatePoint.x, y : rotatePoint.y - fY2};
let controlPoint1Relative = {x : fCX1 - rotatePoint.x, y : rotatePoint.y - fCY1};
let controlPoint2Relative = {x : fCX2 - rotatePoint.x, y : rotatePoint.y - fCY2};

let startPointRelativeRotated = rotatePointAroundCordsStartClockWise(startPointRelative.x, startPointRelative.y, ellipseRotation);
let endPointRelativeRotated = rotatePointAroundCordsStartClockWise(endPointRelative.x, endPointRelative.y, ellipseRotation);
let controlPoint1RelativeRotated = rotatePointAroundCordsStartClockWise(controlPoint1Relative.x, controlPoint1Relative.y, ellipseRotation);
let controlPoint2RelativeRotated = rotatePointAroundCordsStartClockWise(controlPoint2Relative.x, controlPoint2Relative.y, ellipseRotation);

// go to initial cord system
let startPointRotated = {x : startPointRelativeRotated.x + rotatePoint.x, y : rotatePoint.y - startPointRelativeRotated.y};
let endPointRotated = {x : endPointRelativeRotated.x + rotatePoint.x, y : rotatePoint.y - endPointRelativeRotated.y};
let controlPoint1Rotated = {x : controlPoint1RelativeRotated.x + rotatePoint.x, y : rotatePoint.y - controlPoint1RelativeRotated.y};
let controlPoint2Rotated = {x : controlPoint2RelativeRotated.x + rotatePoint.x, y : rotatePoint.y - controlPoint2RelativeRotated.y};

fX1 = startPointRotated.x;
fY1 = startPointRotated.y;
fX2 = endPointRotated.x;
fY2 = endPointRotated.y;
fCX1 = controlPoint1Rotated.x;
fCY1 = controlPoint1Rotated.y;
fCX2 = controlPoint2Rotated.x;
fCY2 = controlPoint2Rotated.y;
}

if ( !bClockDirection )
{
ctx._c(fCX1, fCY1, fCX2, fCY2, fX2, fY2);
Expand Down
12 changes: 11 additions & 1 deletion common/Drawings/CommonController.js
Original file line number Diff line number Diff line change
Expand Up @@ -9744,7 +9744,17 @@
this.Bounds.CheckPoint(_x1, _y1);
this.Bounds.CheckPoint(_x2, _y2);
};

/**
* @param {{x: Number, y: Number, z? :Number}[]} points
*/
CSlideBoundsChecker.prototype.checkPoints = function (points) {
let thisContext = this;
points.forEach(function(point) {
let x = thisContext.m_oFullTransform.TransformPointX(point.x, point.y);
let y = thisContext.m_oFullTransform.TransformPointX(point.x, point.y);
thisContext.Bounds.CheckPoint(x, y);
})
};
// images
CSlideBoundsChecker.prototype.drawImage2 = function(img, x, y, w, h) {
var _x1 = this.m_oFullTransform.TransformPointX(x, y);
Expand Down
9 changes: 9 additions & 0 deletions common/Drawings/Format/ChartSpace.js
Original file line number Diff line number Diff line change
Expand Up @@ -10418,6 +10418,14 @@ function(window, undefined) {
ret.setFill(new AscFormat.CNoFill());
return ret;
}
function CreatePatternFillUniFill(ftype, BgColorUnicolor, FgColorUnicolor) {
var oUniFill = new AscFormat.CUniFill();
oUniFill.fill = new AscFormat.CPattFill();
oUniFill.fill.ftype = ftype;
oUniFill.fill.fgClr = FgColorUnicolor;
oUniFill.fill.bgClr = BgColorUnicolor;
return oUniFill;
}


function CreateView3d(nRotX, nRotY, bRAngAx, nDepthPercent) {
Expand Down Expand Up @@ -11978,6 +11986,7 @@ function(window, undefined) {
window['AscFormat'].CreateUnifillSolidFillSchemeColor = CreateUnifillSolidFillSchemeColor;
window['AscFormat'].CreateNoFillLine = CreateNoFillLine;
window['AscFormat'].CreateNoFillUniFill = CreateNoFillUniFill;
window['AscFormat'].CreatePatternFillUniFill = CreatePatternFillUniFill;
window['AscFormat'].CreateView3d = CreateView3d;
window['AscFormat'].CreateLineChart = CreateLineChart;
window['AscFormat'].CreateBarChart = CreateBarChart;
Expand Down
Loading
Loading