Commit 73626abd authored by Alexander.Trofimov's avatar Alexander.Trofimov

common/Drawings/ColorArray to function-closure

parent 189b30f0
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
"../common/NumFormat.js", "../common/NumFormat.js",
"../common/Drawings/ArcTo.js", "../common/Drawings/ArcTo.js",
"../common/Drawings/ColorArray.js",
"../common/Drawings/Format/Constants.js", "../common/Drawings/Format/Constants.js",
"../common/Drawings/CommonController.js", "../common/Drawings/CommonController.js",
...@@ -85,7 +86,6 @@ ...@@ -85,7 +86,6 @@
"../cell/view/EventsController.js", "../cell/view/EventsController.js",
"../cell/view/WorkbookView.js", "../cell/view/WorkbookView.js",
"../word/Editor/SerializeCommon.js", "../word/Editor/SerializeCommon.js",
"../common/Drawings/ColorArray.js",
"../common/Shapes/Serialize.js", "../common/Shapes/Serialize.js",
"../common/Shapes/SerializeWriter.js", "../common/Shapes/SerializeWriter.js",
"../common/SerializeCommonWordExcel.js", "../common/SerializeCommonWordExcel.js",
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
"../common/NumFormat.js", "../common/NumFormat.js",
"../common/Drawings/ArcTo.js", "../common/Drawings/ArcTo.js",
"../common/Drawings/ColorArray.js",
"../common/Drawings/Format/Constants.js", "../common/Drawings/Format/Constants.js",
"../common/Drawings/CommonController.js", "../common/Drawings/CommonController.js",
...@@ -84,7 +85,6 @@ ...@@ -84,7 +85,6 @@
"../common/Shapes/Serialize.js", "../common/Shapes/Serialize.js",
"../common/Shapes/SerializeWriter.js", "../common/Shapes/SerializeWriter.js",
"../word/Editor/SerializeCommon.js", "../word/Editor/SerializeCommon.js",
"../common/Drawings/ColorArray.js",
"../slide/Editor/Format/Presentation.js", "../slide/Editor/Format/Presentation.js",
"../cell/view/DrawingObjectsController.js", "../cell/view/DrawingObjectsController.js",
"../slide/Editor/DrawingObjectsController.js", "../slide/Editor/DrawingObjectsController.js",
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
"../common/NumFormat.js", "../common/NumFormat.js",
"../common/Drawings/ArcTo.js", "../common/Drawings/ArcTo.js",
"../common/Drawings/ColorArray.js",
"../common/Drawings/Format/Constants.js", "../common/Drawings/Format/Constants.js",
"../common/Drawings/CommonController.js", "../common/Drawings/CommonController.js",
...@@ -59,7 +60,6 @@ ...@@ -59,7 +60,6 @@
"../common/Drawings/TrackObjects/ResizeTracks.js", "../common/Drawings/TrackObjects/ResizeTracks.js",
"../common/Drawings/TrackObjects/RotateTracks.js", "../common/Drawings/TrackObjects/RotateTracks.js",
"../common/Drawings/TrackObjects/Spline.js", "../common/Drawings/TrackObjects/Spline.js",
"../common/Drawings/ColorArray.js",
"../common/Drawings/DrawingObjectsHandlers.js", "../common/Drawings/DrawingObjectsHandlers.js",
"../common/Drawings/Hit.js", "../common/Drawings/Hit.js",
"../common/Drawings/Joined.js", "../common/Drawings/Joined.js",
......
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
// Import // Import
var getFullImageSrc2 = AscCommon.getFullImageSrc2; var getFullImageSrc2 = AscCommon.getFullImageSrc2;
var CShapeColor = AscFormat.CShapeColor;
var c_oAscFill = Asc.c_oAscFill; var c_oAscFill = Asc.c_oAscFill;
function DrawLineEnd(xEnd, yEnd, xPrev, yPrev, type, w, len, drawer, trans) function DrawLineEnd(xEnd, yEnd, xPrev, yPrev, type, w, len, drawer, trans)
......
/* /*
* *
* (c) Copyright Ascensio System Limited 2010-2016 * (c) Copyright Ascensio System Limited 2010-2016
* *
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU * This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html). * General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that * In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights. * Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
* *
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR * THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html * FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
* *
* You can contact Ascensio System SIA by email at sales@onlyoffice.com * You can contact Ascensio System SIA by email at sales@onlyoffice.com
* *
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display * The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3. * Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
* *
* Pursuant to Section 7  3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains * Pursuant to Section 7  3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic * relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE" * form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute. * in every copy of the program you distribute.
* Pursuant to Section 7  3(e) we decline to grant you any rights under trademark law for use of our trademarks. * Pursuant to Section 7  3(e) we decline to grant you any rights under trademark law for use of our trademarks.
* *
*/ */
"use strict"; "use strict";
(function(){
function CShapeColor(r, g, b){ function CShapeColor(r, g, b){
this.r = r; this.r = r;
this.g = g; this.g = g;
...@@ -153,4 +155,9 @@ function HSLToRGB(HSLColor) { //{h : 0..360, s : 0..1, l : 0..1} ...@@ -153,4 +155,9 @@ function HSLToRGB(HSLColor) { //{h : 0..360, s : 0..1, l : 0..1}
if(g>255) g=255; if(g>255) g=255;
if(b>255) b=255; if(b>255) b=255;
return {r : r, g : g, b : b};//{r : 0..255, g : 0..255, b : 0..255} return {r : r, g : g, b : b};//{r : 0..255, g : 0..255, b : 0..255}
} }
\ No newline at end of file
//--------------------------------------------------------export----------------------------------------------------
window['AscFormat'] = window['AscFormat'] || {};
window['AscFormat'].CShapeColor = CShapeColor;
})();
...@@ -856,25 +856,25 @@ CShapeDrawer.prototype = ...@@ -856,25 +856,25 @@ CShapeDrawer.prototype =
var rgba = this.FillUniColor; var rgba = this.FillUniColor;
if (mode == "darken") if (mode == "darken")
{ {
var _color1 = new CShapeColor(rgba.R, rgba.G, rgba.B); var _color1 = new AscFormat.CShapeColor(rgba.R, rgba.G, rgba.B);
var rgb = _color1.darken(); var rgb = _color1.darken();
rgba = { R: rgb.r, G: rgb.g, B: rgb.b, A: rgba.A }; rgba = { R: rgb.r, G: rgb.g, B: rgb.b, A: rgba.A };
} }
else if (mode == "darkenLess") else if (mode == "darkenLess")
{ {
var _color1 = new CShapeColor(rgba.R, rgba.G, rgba.B); var _color1 = new AscFormat.CShapeColor(rgba.R, rgba.G, rgba.B);
var rgb = _color1.darkenLess(); var rgb = _color1.darkenLess();
rgba = { R: rgb.r, G: rgb.g, B: rgb.b, A: rgba.A }; rgba = { R: rgb.r, G: rgb.g, B: rgb.b, A: rgba.A };
} }
else if (mode == "lighten") else if (mode == "lighten")
{ {
var _color1 = new CShapeColor(rgba.R, rgba.G, rgba.B); var _color1 = new AscFormat.CShapeColor(rgba.R, rgba.G, rgba.B);
var rgb = _color1.lighten(); var rgb = _color1.lighten();
rgba = { R: rgb.r, G: rgb.g, B: rgb.b, A: rgba.A }; rgba = { R: rgb.r, G: rgb.g, B: rgb.b, A: rgba.A };
} }
else if (mode == "lightenLess") else if (mode == "lightenLess")
{ {
var _color1 = new CShapeColor(rgba.R, rgba.G, rgba.B); var _color1 = new AscFormat.CShapeColor(rgba.R, rgba.G, rgba.B);
var rgb = _color1.lightenLess(); var rgb = _color1.lightenLess();
rgba = { R: rgb.r, G: rgb.g, B: rgb.b, A: rgba.A }; rgba = { R: rgb.r, G: rgb.g, B: rgb.b, A: rgba.A };
} }
...@@ -1248,25 +1248,25 @@ CShapeDrawer.prototype = ...@@ -1248,25 +1248,25 @@ CShapeDrawer.prototype =
var rgba = this.FillUniColor; var rgba = this.FillUniColor;
if (fill_mode == "darken") if (fill_mode == "darken")
{ {
var _color1 = new CShapeColor(rgba.R, rgba.G, rgba.B); var _color1 = new AscFormat.CShapeColor(rgba.R, rgba.G, rgba.B);
var rgb = _color1.darken(); var rgb = _color1.darken();
rgba = { R: rgb.r, G: rgb.g, B: rgb.b, A: rgba.A }; rgba = { R: rgb.r, G: rgb.g, B: rgb.b, A: rgba.A };
} }
else if (fill_mode == "darkenLess") else if (fill_mode == "darkenLess")
{ {
var _color1 = new CShapeColor(rgba.R, rgba.G, rgba.B); var _color1 = new AscFormat.CShapeColor(rgba.R, rgba.G, rgba.B);
var rgb = _color1.darkenLess(); var rgb = _color1.darkenLess();
rgba = { R: rgb.r, G: rgb.g, B: rgb.b, A: rgba.A }; rgba = { R: rgb.r, G: rgb.g, B: rgb.b, A: rgba.A };
} }
else if (fill_mode == "lighten") else if (fill_mode == "lighten")
{ {
var _color1 = new CShapeColor(rgba.R, rgba.G, rgba.B); var _color1 = new AscFormat.CShapeColor(rgba.R, rgba.G, rgba.B);
var rgb = _color1.lighten(); var rgb = _color1.lighten();
rgba = { R: rgb.r, G: rgb.g, B: rgb.b, A: rgba.A }; rgba = { R: rgb.r, G: rgb.g, B: rgb.b, A: rgba.A };
} }
else if (fill_mode == "lightenLess") else if (fill_mode == "lightenLess")
{ {
var _color1 = new CShapeColor(rgba.R, rgba.G, rgba.B); var _color1 = new AscFormat.CShapeColor(rgba.R, rgba.G, rgba.B);
var rgb = _color1.lightenLess(); var rgb = _color1.lightenLess();
rgba = { R: rgb.r, G: rgb.g, B: rgb.b, A: rgba.A }; rgba = { R: rgb.r, G: rgb.g, B: rgb.b, A: rgba.A };
} }
......
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
// Import // Import
var getFullImageSrc2 = AscCommon.getFullImageSrc2; var getFullImageSrc2 = AscCommon.getFullImageSrc2;
var CShapeColor = AscFormat.CShapeColor;
var c_oAscFill = Asc.c_oAscFill; var c_oAscFill = Asc.c_oAscFill;
window.IsShapeToImageConverter = false; window.IsShapeToImageConverter = false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment