Fix comments indentation

This commit is contained in:
Frederic Junod
2019-02-19 14:12:14 +01:00
parent 7c1e16abc3
commit f0a97ee460
+203 -203
View File
@@ -59,114 +59,114 @@ class Text {
const options = opt_options || {}; const options = opt_options || {};
/** /**
* @private * @private
* @type {string|undefined} * @type {string|undefined}
*/ */
this.font_ = options.font; this.font_ = options.font;
/** /**
* @private * @private
* @type {number|undefined} * @type {number|undefined}
*/ */
this.rotation_ = options.rotation; this.rotation_ = options.rotation;
/** /**
* @private * @private
* @type {boolean|undefined} * @type {boolean|undefined}
*/ */
this.rotateWithView_ = options.rotateWithView; this.rotateWithView_ = options.rotateWithView;
/** /**
* @private * @private
* @type {number|undefined} * @type {number|undefined}
*/ */
this.scale_ = options.scale; this.scale_ = options.scale;
/** /**
* @private * @private
* @type {string|undefined} * @type {string|undefined}
*/ */
this.text_ = options.text; this.text_ = options.text;
/** /**
* @private * @private
* @type {string|undefined} * @type {string|undefined}
*/ */
this.textAlign_ = options.textAlign; this.textAlign_ = options.textAlign;
/** /**
* @private * @private
* @type {string|undefined} * @type {string|undefined}
*/ */
this.textBaseline_ = options.textBaseline; this.textBaseline_ = options.textBaseline;
/** /**
* @private * @private
* @type {import("./Fill.js").default} * @type {import("./Fill.js").default}
*/ */
this.fill_ = options.fill !== undefined ? options.fill : this.fill_ = options.fill !== undefined ? options.fill :
new Fill({color: DEFAULT_FILL_COLOR}); new Fill({color: DEFAULT_FILL_COLOR});
/** /**
* @private * @private
* @type {number} * @type {number}
*/ */
this.maxAngle_ = options.maxAngle !== undefined ? options.maxAngle : Math.PI / 4; this.maxAngle_ = options.maxAngle !== undefined ? options.maxAngle : Math.PI / 4;
/** /**
* @private * @private
* @type {import("./TextPlacement.js").default|string} * @type {import("./TextPlacement.js").default|string}
*/ */
this.placement_ = options.placement !== undefined ? options.placement : TextPlacement.POINT; this.placement_ = options.placement !== undefined ? options.placement : TextPlacement.POINT;
/** /**
* @private * @private
* @type {boolean} * @type {boolean}
*/ */
this.overflow_ = !!options.overflow; this.overflow_ = !!options.overflow;
/** /**
* @private * @private
* @type {import("./Stroke.js").default} * @type {import("./Stroke.js").default}
*/ */
this.stroke_ = options.stroke !== undefined ? options.stroke : null; this.stroke_ = options.stroke !== undefined ? options.stroke : null;
/** /**
* @private * @private
* @type {number} * @type {number}
*/ */
this.offsetX_ = options.offsetX !== undefined ? options.offsetX : 0; this.offsetX_ = options.offsetX !== undefined ? options.offsetX : 0;
/** /**
* @private * @private
* @type {number} * @type {number}
*/ */
this.offsetY_ = options.offsetY !== undefined ? options.offsetY : 0; this.offsetY_ = options.offsetY !== undefined ? options.offsetY : 0;
/** /**
* @private * @private
* @type {import("./Fill.js").default} * @type {import("./Fill.js").default}
*/ */
this.backgroundFill_ = options.backgroundFill ? options.backgroundFill : null; this.backgroundFill_ = options.backgroundFill ? options.backgroundFill : null;
/** /**
* @private * @private
* @type {import("./Stroke.js").default} * @type {import("./Stroke.js").default}
*/ */
this.backgroundStroke_ = options.backgroundStroke ? options.backgroundStroke : null; this.backgroundStroke_ = options.backgroundStroke ? options.backgroundStroke : null;
/** /**
* @private * @private
* @type {Array<number>} * @type {Array<number>}
*/ */
this.padding_ = options.padding === undefined ? null : options.padding; this.padding_ = options.padding === undefined ? null : options.padding;
} }
/** /**
* Clones the style. * Clones the style.
* @return {Text} The cloned style. * @return {Text} The cloned style.
* @api * @api
*/ */
clone() { clone() {
return new Text({ return new Text({
font: this.getFont(), font: this.getFont(),
@@ -189,314 +189,314 @@ class Text {
} }
/** /**
* Get the `overflow` configuration. * Get the `overflow` configuration.
* @return {boolean} Let text overflow the length of the path they follow. * @return {boolean} Let text overflow the length of the path they follow.
* @api * @api
*/ */
getOverflow() { getOverflow() {
return this.overflow_; return this.overflow_;
} }
/** /**
* Get the font name. * Get the font name.
* @return {string|undefined} Font. * @return {string|undefined} Font.
* @api * @api
*/ */
getFont() { getFont() {
return this.font_; return this.font_;
} }
/** /**
* Get the maximum angle between adjacent characters. * Get the maximum angle between adjacent characters.
* @return {number} Angle in radians. * @return {number} Angle in radians.
* @api * @api
*/ */
getMaxAngle() { getMaxAngle() {
return this.maxAngle_; return this.maxAngle_;
} }
/** /**
* Get the label placement. * Get the label placement.
* @return {import("./TextPlacement.js").default|string} Text placement. * @return {import("./TextPlacement.js").default|string} Text placement.
* @api * @api
*/ */
getPlacement() { getPlacement() {
return this.placement_; return this.placement_;
} }
/** /**
* Get the x-offset for the text. * Get the x-offset for the text.
* @return {number} Horizontal text offset. * @return {number} Horizontal text offset.
* @api * @api
*/ */
getOffsetX() { getOffsetX() {
return this.offsetX_; return this.offsetX_;
} }
/** /**
* Get the y-offset for the text. * Get the y-offset for the text.
* @return {number} Vertical text offset. * @return {number} Vertical text offset.
* @api * @api
*/ */
getOffsetY() { getOffsetY() {
return this.offsetY_; return this.offsetY_;
} }
/** /**
* Get the fill style for the text. * Get the fill style for the text.
* @return {import("./Fill.js").default} Fill style. * @return {import("./Fill.js").default} Fill style.
* @api * @api
*/ */
getFill() { getFill() {
return this.fill_; return this.fill_;
} }
/** /**
* Determine whether the text rotates with the map. * Determine whether the text rotates with the map.
* @return {boolean|undefined} Rotate with map. * @return {boolean|undefined} Rotate with map.
* @api * @api
*/ */
getRotateWithView() { getRotateWithView() {
return this.rotateWithView_; return this.rotateWithView_;
} }
/** /**
* Get the text rotation. * Get the text rotation.
* @return {number|undefined} Rotation. * @return {number|undefined} Rotation.
* @api * @api
*/ */
getRotation() { getRotation() {
return this.rotation_; return this.rotation_;
} }
/** /**
* Get the text scale. * Get the text scale.
* @return {number|undefined} Scale. * @return {number|undefined} Scale.
* @api * @api
*/ */
getScale() { getScale() {
return this.scale_; return this.scale_;
} }
/** /**
* Get the stroke style for the text. * Get the stroke style for the text.
* @return {import("./Stroke.js").default} Stroke style. * @return {import("./Stroke.js").default} Stroke style.
* @api * @api
*/ */
getStroke() { getStroke() {
return this.stroke_; return this.stroke_;
} }
/** /**
* Get the text to be rendered. * Get the text to be rendered.
* @return {string|undefined} Text. * @return {string|undefined} Text.
* @api * @api
*/ */
getText() { getText() {
return this.text_; return this.text_;
} }
/** /**
* Get the text alignment. * Get the text alignment.
* @return {string|undefined} Text align. * @return {string|undefined} Text align.
* @api * @api
*/ */
getTextAlign() { getTextAlign() {
return this.textAlign_; return this.textAlign_;
} }
/** /**
* Get the text baseline. * Get the text baseline.
* @return {string|undefined} Text baseline. * @return {string|undefined} Text baseline.
* @api * @api
*/ */
getTextBaseline() { getTextBaseline() {
return this.textBaseline_; return this.textBaseline_;
} }
/** /**
* Get the background fill style for the text. * Get the background fill style for the text.
* @return {import("./Fill.js").default} Fill style. * @return {import("./Fill.js").default} Fill style.
* @api * @api
*/ */
getBackgroundFill() { getBackgroundFill() {
return this.backgroundFill_; return this.backgroundFill_;
} }
/** /**
* Get the background stroke style for the text. * Get the background stroke style for the text.
* @return {import("./Stroke.js").default} Stroke style. * @return {import("./Stroke.js").default} Stroke style.
* @api * @api
*/ */
getBackgroundStroke() { getBackgroundStroke() {
return this.backgroundStroke_; return this.backgroundStroke_;
} }
/** /**
* Get the padding for the text. * Get the padding for the text.
* @return {Array<number>} Padding. * @return {Array<number>} Padding.
* @api * @api
*/ */
getPadding() { getPadding() {
return this.padding_; return this.padding_;
} }
/** /**
* Set the `overflow` property. * Set the `overflow` property.
* *
* @param {boolean} overflow Let text overflow the path that it follows. * @param {boolean} overflow Let text overflow the path that it follows.
* @api * @api
*/ */
setOverflow(overflow) { setOverflow(overflow) {
this.overflow_ = overflow; this.overflow_ = overflow;
} }
/** /**
* Set the font. * Set the font.
* *
* @param {string|undefined} font Font. * @param {string|undefined} font Font.
* @api * @api
*/ */
setFont(font) { setFont(font) {
this.font_ = font; this.font_ = font;
} }
/** /**
* Set the maximum angle between adjacent characters. * Set the maximum angle between adjacent characters.
* *
* @param {number} maxAngle Angle in radians. * @param {number} maxAngle Angle in radians.
* @api * @api
*/ */
setMaxAngle(maxAngle) { setMaxAngle(maxAngle) {
this.maxAngle_ = maxAngle; this.maxAngle_ = maxAngle;
} }
/** /**
* Set the x offset. * Set the x offset.
* *
* @param {number} offsetX Horizontal text offset. * @param {number} offsetX Horizontal text offset.
* @api * @api
*/ */
setOffsetX(offsetX) { setOffsetX(offsetX) {
this.offsetX_ = offsetX; this.offsetX_ = offsetX;
} }
/** /**
* Set the y offset. * Set the y offset.
* *
* @param {number} offsetY Vertical text offset. * @param {number} offsetY Vertical text offset.
* @api * @api
*/ */
setOffsetY(offsetY) { setOffsetY(offsetY) {
this.offsetY_ = offsetY; this.offsetY_ = offsetY;
} }
/** /**
* Set the text placement. * Set the text placement.
* *
* @param {import("./TextPlacement.js").default|string} placement Placement. * @param {import("./TextPlacement.js").default|string} placement Placement.
* @api * @api
*/ */
setPlacement(placement) { setPlacement(placement) {
this.placement_ = placement; this.placement_ = placement;
} }
/** /**
* Set the fill. * Set the fill.
* *
* @param {import("./Fill.js").default} fill Fill style. * @param {import("./Fill.js").default} fill Fill style.
* @api * @api
*/ */
setFill(fill) { setFill(fill) {
this.fill_ = fill; this.fill_ = fill;
} }
/** /**
* Set the rotation. * Set the rotation.
* *
* @param {number|undefined} rotation Rotation. * @param {number|undefined} rotation Rotation.
* @api * @api
*/ */
setRotation(rotation) { setRotation(rotation) {
this.rotation_ = rotation; this.rotation_ = rotation;
} }
/** /**
* Set the scale. * Set the scale.
* *
* @param {number|undefined} scale Scale. * @param {number|undefined} scale Scale.
* @api * @api
*/ */
setScale(scale) { setScale(scale) {
this.scale_ = scale; this.scale_ = scale;
} }
/** /**
* Set the stroke. * Set the stroke.
* *
* @param {import("./Stroke.js").default} stroke Stroke style. * @param {import("./Stroke.js").default} stroke Stroke style.
* @api * @api
*/ */
setStroke(stroke) { setStroke(stroke) {
this.stroke_ = stroke; this.stroke_ = stroke;
} }
/** /**
* Set the text. * Set the text.
* *
* @param {string|undefined} text Text. * @param {string|undefined} text Text.
* @api * @api
*/ */
setText(text) { setText(text) {
this.text_ = text; this.text_ = text;
} }
/** /**
* Set the text alignment. * Set the text alignment.
* *
* @param {string|undefined} textAlign Text align. * @param {string|undefined} textAlign Text align.
* @api * @api
*/ */
setTextAlign(textAlign) { setTextAlign(textAlign) {
this.textAlign_ = textAlign; this.textAlign_ = textAlign;
} }
/** /**
* Set the text baseline. * Set the text baseline.
* *
* @param {string|undefined} textBaseline Text baseline. * @param {string|undefined} textBaseline Text baseline.
* @api * @api
*/ */
setTextBaseline(textBaseline) { setTextBaseline(textBaseline) {
this.textBaseline_ = textBaseline; this.textBaseline_ = textBaseline;
} }
/** /**
* Set the background fill. * Set the background fill.
* *
* @param {import("./Fill.js").default} fill Fill style. * @param {import("./Fill.js").default} fill Fill style.
* @api * @api
*/ */
setBackgroundFill(fill) { setBackgroundFill(fill) {
this.backgroundFill_ = fill; this.backgroundFill_ = fill;
} }
/** /**
* Set the background stroke. * Set the background stroke.
* *
* @param {import("./Stroke.js").default} stroke Stroke style. * @param {import("./Stroke.js").default} stroke Stroke style.
* @api * @api
*/ */
setBackgroundStroke(stroke) { setBackgroundStroke(stroke) {
this.backgroundStroke_ = stroke; this.backgroundStroke_ = stroke;
} }
/** /**
* Set the padding (`[top, right, bottom, left]`). * Set the padding (`[top, right, bottom, left]`).
* *
* @param {!Array<number>} padding Padding. * @param {!Array<number>} padding Padding.
* @api * @api
*/ */
setPadding(padding) { setPadding(padding) {
this.padding_ = padding; this.padding_ = padding;
} }