Skip to content

Commit 32da0ae

Browse files
committed
DVF-2507 library update
1 parent ca60d22 commit 32da0ae

File tree

5 files changed

+45
-54
lines changed

5 files changed

+45
-54
lines changed

build

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ import time
1212
#=======================================================================================================================
1313
# Project paths
1414
#=======================================================================================================================
15+
COMPILER_VERSION = '20161024'
1516
PROJECT_PATH = os.path.abspath(os.path.dirname(__file__))
1617
CONTRIB_PATH = os.path.join(PROJECT_PATH, 'contrib')
17-
COMPILER_PATH = os.path.join(CONTRIB_PATH, 'compiler', 'compiler.jar')
18+
COMPILER_PATH = os.path.join(CONTRIB_PATH, 'compiler', 'closure-compiler-v%s.jar' % COMPILER_VERSION)
1819
SRC_PATH = os.path.join(PROJECT_PATH, 'src')
1920
OUT_PATH = os.path.join(PROJECT_PATH, 'out')
2021
CLOSURE_LIBRARY_PATH = os.path.join(CONTRIB_PATH, 'closure-library')
@@ -74,10 +75,10 @@ def __sync_contrib():
7475

7576
#Download closure compiler
7677
if not os.path.exists(COMPILER_PATH):
77-
print 'Downloading Google Closure Compiler v.20151216'
78+
print 'Downloading Google Closure Compiler v.' + COMPILER_VERSION
7879
try:
7980
__download_and_unzip_from_http(
80-
'http://dl.google.com/closure-compiler/compiler-20151216.zip',
81+
"http://dl.google.com/closure-compiler/compiler-%s.zip" % COMPILER_VERSION,
8182
'compiler'
8283
)
8384
except StandardError as e:
@@ -152,53 +153,56 @@ def __getNotOptimizedCompilerArgs():
152153
def __getOptimizedCompilerArgs():
153154
compilerArgs = [
154155
'--compilation_level ADVANCED_OPTIMIZATIONS',
155-
'--warning_level VERBOSE',
156156
'--output_wrapper "(function(){%output%})();"',
157+
'--assume_function_wrapper',
158+
# '--output_manifest',
159+
# '--new_type_inf',
160+
'--env BROWSER',
161+
'--warning_level VERBOSE',
157162
'--jscomp_warning accessControls',
158163
'--jscomp_warning ambiguousFunctionDecl',
159-
'--jscomp_warning checkDebuggerStatement',
160164
'--jscomp_warning checkEventfulObjectDisposal',
161165
'--jscomp_warning checkRegExp',
162166
'--jscomp_warning checkTypes',
163167
'--jscomp_warning checkVars',
164-
'--jscomp_warning closureDepMethodUsageChecks',
168+
'--jscomp_warning commonJsModuleLoad',
165169
'--jscomp_warning conformanceViolations',
166170
'--jscomp_warning const',
167171
'--jscomp_warning constantProperty',
168172
'--jscomp_warning deprecated',
169173
'--jscomp_warning deprecatedAnnotations',
170-
'--jscomp_warning duplicate',
171174
'--jscomp_warning duplicateMessage',
172175
'--jscomp_warning es3',
173176
'--jscomp_warning es5Strict',
174177
'--jscomp_warning externsValidation',
175-
'--jscomp_warning extraRequire',
176178
'--jscomp_warning fileoverviewTags',
179+
'--jscomp_warning functionParams',
177180
'--jscomp_warning globalThis',
178-
'--jscomp_warning inferredConstCheck',
179181
'--jscomp_warning internetExplorerChecks',
180182
'--jscomp_warning invalidCasts',
181183
'--jscomp_warning misplacedTypeAnnotation',
182184
'--jscomp_warning missingGetCssName',
185+
# '--jscomp_warning missingOverride',
186+
'--jscomp_warning missingPolyfill',
183187
'--jscomp_warning missingProperties',
184188
'--jscomp_warning missingProvide',
185189
'--jscomp_warning missingRequire',
186190
'--jscomp_warning missingReturn',
191+
'--jscomp_warning msgDescriptions',
187192
'--jscomp_warning newCheckTypes',
188-
#'--jscomp_warning msgDescriptionsNewCheckTypes',
189193
'--jscomp_warning nonStandardJsDocs',
190-
#'--jscomp_warning reportUnknownTypes',
194+
# '--jscomp_warning reportUnknownTypes',
191195
'--jscomp_warning suspiciousCode',
192196
'--jscomp_warning strictModuleDepCheck',
193-
'--jscomp_warning tweakValidation',
194197
'--jscomp_warning typeInvalidation',
195198
'--jscomp_warning undefinedNames',
196199
'--jscomp_warning undefinedVars',
197200
'--jscomp_warning unknownDefines',
198-
#+'--jscomp_warning unnecessaryCasts',
201+
'--jscomp_warning unusedLocalVariables',
202+
# '--jscomp_warning unusedPrivateMembers',
199203
'--jscomp_warning uselessCode',
200-
#+'--jscomp_warning useOfGoogBase',
201-
'--jscomp_warning violatedModuleDep',
204+
# '--jscomp_warning useOfGoogBase',
205+
'--jscomp_warning underscore',
202206
'--jscomp_warning visibility',
203207
]
204208
return compilerArgs
@@ -208,13 +212,14 @@ def __getDefaultCompilerArgs(outputFile):
208212
result = [
209213
'java -jar',
210214
COMPILER_PATH,
211-
'--charset UTF-8',
212-
'--only_closure_dependencies',
213215
'--externs ' + EXTERNS_PATH,
214216
'--js="%s"' % os.path.join(SRC_PATH, '**.js'),
215217
'--js="%s"' % os.path.join(CLOSURE_LIBRARY_PATH, '**.js'),
216-
'--closure_entry_point acgraph',
217-
'--js_output_file ' + outputFile
218+
'--js_output_file ' + outputFile,
219+
'--charset UTF-8',
220+
'--dependency_mode=STRICT',
221+
'--entry_point acgraph',
222+
'--hide_warnings_for="contrib"'
218223
]
219224
return result
220225

contrib/closure-library

Submodule closure-library updated 1415 files

src/vector/PathBase.js

Lines changed: 19 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ goog.inherits(acgraph.vector.PathBase, acgraph.vector.Shape);
5353
* @enum {number}
5454
*/
5555
acgraph.vector.PathBase.Segment = {
56-
MOVETO: 0,
57-
LINETO: 1,
58-
CURVETO: 2,
59-
ARCTO: 3,
60-
CLOSE: 4
56+
MOVETO: 1,
57+
LINETO: 2,
58+
CURVETO: 3,
59+
ARCTO: 4,
60+
CLOSE: 5
6161
};
6262

6363

@@ -407,15 +407,6 @@ acgraph.vector.PathBase.prototype.currentPoint_ = null;
407407
acgraph.vector.PathBase.prototype.simple_ = true;
408408

409409

410-
/**
411-
* Flag showing if there are any CURVETO elements in path.
412-
*
413-
* @type {boolean}
414-
* @private
415-
*/
416-
acgraph.vector.PathBase.prototype.hasCurves_ = false;
417-
418-
419410
/**
420411
* Transformed path arguments cache. Resets upon changes and transformations.
421412
* @type {Array.<number>}
@@ -607,8 +598,6 @@ acgraph.vector.PathBase.prototype.curveToInternal = function(control1X, control1
607598
this.dropBoundsCache();
608599
this.transformedPathCache_ = null;
609600

610-
this.hasCurves_ = true;
611-
612601
return this;
613602
};
614603

@@ -1039,20 +1028,20 @@ acgraph.vector.PathBase.boundsCalculationMap_ = (function() {
10391028
})();
10401029

10411030

1042-
/**
1043-
* Types of segment and functions to calculate bounds.
1044-
* @type {!Array.<Function>}
1045-
* @private
1046-
*/
1047-
acgraph.vector.PathBase.boundsRoughCalculationMap_ = (function() {
1048-
var map = [];
1049-
map[acgraph.vector.PathBase.Segment.MOVETO] = goog.nullFunction;
1050-
map[acgraph.vector.PathBase.Segment.LINETO] = acgraph.vector.PathBase.calcLineBounds_;
1051-
map[acgraph.vector.PathBase.Segment.CLOSE] = goog.nullFunction;
1052-
map[acgraph.vector.PathBase.Segment.CURVETO] = acgraph.vector.PathBase.calcRoughCurveBounds_;
1053-
map[acgraph.vector.PathBase.Segment.ARCTO] = acgraph.vector.PathBase.calcArcBounds_;
1054-
return map;
1055-
})();
1031+
// /**
1032+
// * Types of segment and functions to calculate bounds.
1033+
// * @type {!Array.<Function>}
1034+
// * @private
1035+
// */
1036+
// acgraph.vector.PathBase.boundsRoughCalculationMap_ = (function() {
1037+
// var map = [];
1038+
// map[acgraph.vector.PathBase.Segment.MOVETO] = goog.nullFunction;
1039+
// map[acgraph.vector.PathBase.Segment.LINETO] = acgraph.vector.PathBase.calcLineBounds_;
1040+
// map[acgraph.vector.PathBase.Segment.CLOSE] = goog.nullFunction;
1041+
// map[acgraph.vector.PathBase.Segment.CURVETO] = acgraph.vector.PathBase.calcRoughCurveBounds_;
1042+
// map[acgraph.vector.PathBase.Segment.ARCTO] = acgraph.vector.PathBase.calcArcBounds_;
1043+
// return map;
1044+
// })();
10561045

10571046

10581047
//----------------------------------------------------------------------------------------------------------------------

src/vector/vector.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ acgraph.vector.normalizeStroke = function(opt_strokeOrFill, opt_thickness, opt_d
823823
(setAsComplexStroke && ('thickness' in opt_strokeOrFill)) ?
824824
opt_strokeOrFill['thickness'] :
825825
opt_thickness);
826-
if (thickness == 0) // if thickness is set and set to 0
826+
if (!isNaN(thickness) && !thickness) // if thickness is set and set to 0
827827
return 'none';
828828

829829
var hasDash = setAsComplexStroke && ('dash' in opt_strokeOrFill);

src/vector/vml/Renderer.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,6 @@ acgraph.vector.vml.Renderer.prototype.measure = function(text, style) {
420420
var boundsMicroText = goog.style.getBounds(this.virtualBaseLine_);
421421
goog.style.setPosition(this.measurement_, 0, -(boundsMicroText.top + boundsMicroText.height));
422422

423-
var size = goog.style.getFontSize(this.measurementText_);
424423
var boundsTargetText = goog.style.getBounds(this.measurementText_);
425424

426425
boundsTargetText.width = width + additionWidth;
@@ -1444,7 +1443,6 @@ acgraph.vector.vml.Renderer.prototype.setTextProperties = function(element) {
14441443
} else {
14451444
var text = element.getSimpleText();
14461445
if (text == null) return;
1447-
var style = element.style();
14481446

14491447
if (element.fontSize()) goog.style.setStyle(domElement, 'font-size', /** @type {number|string} */ (element.fontSize()));
14501448
if (element.color()) goog.style.setStyle(domElement, 'color', /** @type {string} */ (element.color()));
@@ -1989,7 +1987,6 @@ acgraph.vector.vml.Renderer.prototype.setEllipseTransformation = function(elemen
19891987
/** @inheritDoc */
19901988
acgraph.vector.vml.Renderer.prototype.setImageTransformation = function(element) {
19911989
var style = element.domElement()['style'];
1992-
var bounds = element.getBoundsWithoutTransform();
19931990

19941991
/** @type {goog.graphics.AffineTransform} */
19951992
var tx = element.getFullTransformation();

0 commit comments

Comments
 (0)