Commit 20ea07cb authored by Alexander.Trofimov's avatar Alexander.Trofimov

move HatchPattern to common

common/Drawings/HatchPattern to function-closure
parent f2e85de6
...@@ -64,6 +64,7 @@ ...@@ -64,6 +64,7 @@
"../common/CollaborativeEditingBase.js", "../common/CollaborativeEditingBase.js",
"../common/Controls.js", "../common/Controls.js",
"../common/Overlay.js", "../common/Overlay.js",
"../common/Drawings/HatchPattern.js",
"../common/scroll.js", "../common/scroll.js",
"../cell/view/iscroll.js", "../cell/view/iscroll.js",
...@@ -71,7 +72,7 @@ ...@@ -71,7 +72,7 @@
"../common/wordcopypaste.js", "../common/wordcopypaste.js",
"../cell/apiDefines.js", "../cell/apiDefines.js",
"../word/Drawing/HatchPattern.js",
"../word/Drawing/WorkEvents.js", "../word/Drawing/WorkEvents.js",
"../cell/document/empty-workbook.js", "../cell/document/empty-workbook.js",
"../cell/utils/utils.js", "../cell/utils/utils.js",
......
...@@ -64,6 +64,7 @@ ...@@ -64,6 +64,7 @@
"../common/CollaborativeEditingBase.js", "../common/CollaborativeEditingBase.js",
"../common/Controls.js", "../common/Controls.js",
"../common/Overlay.js", "../common/Overlay.js",
"../common/Drawings/HatchPattern.js",
"../common/scroll.js", "../common/scroll.js",
...@@ -88,7 +89,6 @@ ...@@ -88,7 +89,6 @@
"../word/Editor/Common.js", "../word/Editor/Common.js",
"../word/Editor/Sections.js", "../word/Editor/Sections.js",
"../word/Editor/History.js", "../word/Editor/History.js",
"../word/Drawing/HatchPattern.js",
"../word/Drawing/Graphics.js", "../word/Drawing/Graphics.js",
"../word/Drawing/ShapeDrawer.js", "../word/Drawing/ShapeDrawer.js",
"../slide/Drawing/Transitions.js", "../slide/Drawing/Transitions.js",
......
...@@ -67,6 +67,7 @@ ...@@ -67,6 +67,7 @@
"../common/CollaborativeEditingBase.js", "../common/CollaborativeEditingBase.js",
"../common/Controls.js", "../common/Controls.js",
"../common/Overlay.js", "../common/Overlay.js",
"../common/Drawings/HatchPattern.js",
"../common/scroll.js", "../common/scroll.js",
"../common/Scrolls/iscroll.js", "../common/Scrolls/iscroll.js",
...@@ -112,7 +113,6 @@ ...@@ -112,7 +113,6 @@
"../word/Editor/FontClassification.js", "../word/Editor/FontClassification.js",
"../word/Editor/Spelling.js", "../word/Editor/Spelling.js",
"../word/Drawing/Graphics.js", "../word/Drawing/Graphics.js",
"../word/Drawing/HatchPattern.js",
"../word/Drawing/ShapeDrawer.js", "../word/Drawing/ShapeDrawer.js",
"../word/Drawing/DrawingDocument.js", "../word/Drawing/DrawingDocument.js",
"../word/Drawing/GraphicsEvents.js", "../word/Drawing/GraphicsEvents.js",
......
...@@ -1003,7 +1003,7 @@ CShapeDrawer.prototype = ...@@ -1003,7 +1003,7 @@ CShapeDrawer.prototype =
var _ctx = (this.Graphics.IsTrack === true) ? this.Graphics.Graphics.m_oContext : this.Graphics.m_oContext; var _ctx = (this.Graphics.IsTrack === true) ? this.Graphics.Graphics.m_oContext : this.Graphics.m_oContext;
var _patt_name = global_hatch_names[_fill.ftype]; var _patt_name = AscCommon.global_hatch_names[_fill.ftype];
if (undefined == _patt_name) if (undefined == _patt_name)
_patt_name = "cross"; _patt_name = "cross";
...@@ -1013,7 +1013,7 @@ CShapeDrawer.prototype = ...@@ -1013,7 +1013,7 @@ CShapeDrawer.prototype =
var __fa = (null === this.UniFill.transparent) ? _fc.A : 255; var __fa = (null === this.UniFill.transparent) ? _fc.A : 255;
var __ba = (null === this.UniFill.transparent) ? _bc.A : 255; var __ba = (null === this.UniFill.transparent) ? _bc.A : 255;
var _test_pattern = GetHatchBrush(_patt_name, _fc.R, _fc.G, _fc.B, __fa, _bc.R, _bc.G, _bc.B, __ba); var _test_pattern = AscCommon.GetHatchBrush(_patt_name, _fc.R, _fc.G, _fc.B, __fa, _bc.R, _bc.G, _bc.B, __ba);
var patt = _ctx.createPattern(_test_pattern.Canvas, "repeat"); var patt = _ctx.createPattern(_test_pattern.Canvas, "repeat");
_ctx.save(); _ctx.save();
...@@ -1387,7 +1387,7 @@ CShapeDrawer.prototype = ...@@ -1387,7 +1387,7 @@ CShapeDrawer.prototype =
var _fill = this.UniFill.fill; var _fill = this.UniFill.fill;
if (_fill.type == c_oAscFill.FILL_TYPE_PATT) if (_fill.type == c_oAscFill.FILL_TYPE_PATT)
{ {
var _patt_name = global_hatch_names[_fill.ftype]; var _patt_name = AscCommon.global_hatch_names[_fill.ftype];
if (undefined == _patt_name) if (undefined == _patt_name)
_patt_name = "cross"; _patt_name = "cross";
...@@ -1397,7 +1397,7 @@ CShapeDrawer.prototype = ...@@ -1397,7 +1397,7 @@ CShapeDrawer.prototype =
var __fa = (null === this.UniFill.transparent) ? _fc.A : 255; var __fa = (null === this.UniFill.transparent) ? _fc.A : 255;
var __ba = (null === this.UniFill.transparent) ? _bc.A : 255; var __ba = (null === this.UniFill.transparent) ? _bc.A : 255;
var _pattern = GetHatchBrush(_patt_name, _fc.R, _fc.G, _fc.B, __fa, _bc.R, _bc.G, _bc.B, __ba); var _pattern = AscCommon.GetHatchBrush(_patt_name, _fc.R, _fc.G, _fc.B, __fa, _bc.R, _bc.G, _bc.B, __ba);
var _url64 = ""; var _url64 = "";
try try
......
"use strict"; "use strict";
(function(window, undefined){
var global_hatch_data = [ var global_hatch_data = [
/* cross */ /* cross */
0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
...@@ -749,3 +751,9 @@ function GetHatchBrush(name, r, g, b, a, br, bg, bb, ba) ...@@ -749,3 +751,9 @@ function GetHatchBrush(name, r, g, b, a, br, bg, bb, ba)
global_hatch_brushes[name] = _brush; global_hatch_brushes[name] = _brush;
return _brush; return _brush;
} }
//--------------------------------------------------------export----------------------------------------------------
window['AscCommon'] = window['AscCommon'] || {};
window['AscCommon'].global_hatch_names = global_hatch_names;
window['AscCommon'].GetHatchBrush = GetHatchBrush;
})(window);
...@@ -906,7 +906,7 @@ CShapeDrawer.prototype = ...@@ -906,7 +906,7 @@ CShapeDrawer.prototype =
} }
case Asc.c_oAscFill.FILL_TYPE_PATT: case Asc.c_oAscFill.FILL_TYPE_PATT:
{ {
var _patt_name = global_hatch_names[_fill.ftype]; var _patt_name = AscCommon.global_hatch_names[_fill.ftype];
if (undefined == _patt_name) if (undefined == _patt_name)
_patt_name = "cross"; _patt_name = "cross";
...@@ -1166,7 +1166,7 @@ CShapeDrawer.prototype = ...@@ -1166,7 +1166,7 @@ CShapeDrawer.prototype =
var _fill = this.UniFill.fill; var _fill = this.UniFill.fill;
if (_fill.type == Asc.c_oAscFill.FILL_TYPE_PATT) if (_fill.type == Asc.c_oAscFill.FILL_TYPE_PATT)
{ {
var _patt_name = global_hatch_names[_fill.ftype]; var _patt_name = AscCommon.global_hatch_names[_fill.ftype];
if (undefined == _patt_name) if (undefined == _patt_name)
_patt_name = "cross"; _patt_name = "cross";
...@@ -1176,7 +1176,7 @@ CShapeDrawer.prototype = ...@@ -1176,7 +1176,7 @@ CShapeDrawer.prototype =
var __fa = (null === this.UniFill.transparent) ? _fc.A : 255; var __fa = (null === this.UniFill.transparent) ? _fc.A : 255;
var __ba = (null === this.UniFill.transparent) ? _bc.A : 255; var __ba = (null === this.UniFill.transparent) ? _bc.A : 255;
var _pattern = GetHatchBrush(_patt_name, _fc.R, _fc.G, _fc.B, __fa, _bc.R, _bc.G, _bc.B, __ba); var _pattern = AscCommon.GetHatchBrush(_patt_name, _fc.R, _fc.G, _fc.B, __fa, _bc.R, _bc.G, _bc.B, __ba);
var _url64 = ""; var _url64 = "";
try try
......
...@@ -976,7 +976,7 @@ CShapeDrawer.prototype = ...@@ -976,7 +976,7 @@ CShapeDrawer.prototype =
var _ctx = (this.Graphics.IsTrack === true) ? this.Graphics.Graphics.m_oContext : this.Graphics.m_oContext; var _ctx = (this.Graphics.IsTrack === true) ? this.Graphics.Graphics.m_oContext : this.Graphics.m_oContext;
var _patt_name = global_hatch_names[_fill.ftype]; var _patt_name = AscCommon.global_hatch_names[_fill.ftype];
if (undefined == _patt_name) if (undefined == _patt_name)
_patt_name = "cross"; _patt_name = "cross";
...@@ -986,7 +986,7 @@ CShapeDrawer.prototype = ...@@ -986,7 +986,7 @@ CShapeDrawer.prototype =
var __fa = (null === this.UniFill.transparent) ? _fc.A : 255; var __fa = (null === this.UniFill.transparent) ? _fc.A : 255;
var __ba = (null === this.UniFill.transparent) ? _bc.A : 255; var __ba = (null === this.UniFill.transparent) ? _bc.A : 255;
var _test_pattern = GetHatchBrush(_patt_name, _fc.R, _fc.G, _fc.B, __fa, _bc.R, _bc.G, _bc.B, __ba); var _test_pattern = AscCommon.GetHatchBrush(_patt_name, _fc.R, _fc.G, _fc.B, __fa, _bc.R, _bc.G, _bc.B, __ba);
var patt = _ctx.createPattern(_test_pattern.Canvas, "repeat"); var patt = _ctx.createPattern(_test_pattern.Canvas, "repeat");
_ctx.save(); _ctx.save();
...@@ -1372,7 +1372,7 @@ CShapeDrawer.prototype = ...@@ -1372,7 +1372,7 @@ CShapeDrawer.prototype =
var _fill = this.UniFill.fill; var _fill = this.UniFill.fill;
if (_fill.type == c_oAscFill.FILL_TYPE_PATT) if (_fill.type == c_oAscFill.FILL_TYPE_PATT)
{ {
var _patt_name = global_hatch_names[_fill.ftype]; var _patt_name = AscCommon.global_hatch_names[_fill.ftype];
if (undefined == _patt_name) if (undefined == _patt_name)
_patt_name = "cross"; _patt_name = "cross";
...@@ -1382,7 +1382,7 @@ CShapeDrawer.prototype = ...@@ -1382,7 +1382,7 @@ CShapeDrawer.prototype =
var __fa = (null === this.UniFill.transparent) ? _fc.A : 255; var __fa = (null === this.UniFill.transparent) ? _fc.A : 255;
var __ba = (null === this.UniFill.transparent) ? _bc.A : 255; var __ba = (null === this.UniFill.transparent) ? _bc.A : 255;
var _pattern = GetHatchBrush(_patt_name, _fc.R, _fc.G, _fc.B, __fa, _bc.R, _bc.G, _bc.B, __ba); var _pattern = AscCommon.GetHatchBrush(_patt_name, _fc.R, _fc.G, _fc.B, __fa, _bc.R, _bc.G, _bc.B, __ba);
var _url64 = ""; var _url64 = "";
try try
......
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