Skip to content

Commit 7caae6b

Browse files
committed
Reference other constants
1 parent 3d4c8e1 commit 7caae6b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/type/p5.Font.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
* @module Typography
33
*/
44

5-
import { textCoreConstants } from './textCore.js';
5+
import { textCoreConstants } from './textCore';
6+
import * as constants from '../core/constants';
67

78
/*
89
API:
@@ -329,19 +330,19 @@ class Font {
329330
let x = bounds.x;
330331
let y = bounds.y + (i * textLeading) + ascent;
331332
let lineWidth = renderer._fontWidthSingle(text);
332-
if (textAlign === fn.CENTER) {
333+
if (textAlign === constants.CENTER) {
333334
x += (bounds.w - lineWidth) / 2;
334335
}
335-
else if (textAlign === fn.RIGHT) {
336+
else if (textAlign === constants.RIGHT) {
336337
x += (bounds.w - lineWidth);
337338
}
338339
if (typeof width !== 'undefined') {
339340
switch (renderer.states.rectMode) {
340-
case fn.CENTER:
341+
case constants.CENTER:
341342
x -= width / 2;
342343
y -= height / 2;
343344
break;
344-
case fn.RADIUS:
345+
case constants.RADIUS:
345346
x -= width;
346347
y -= height;
347348
break;

0 commit comments

Comments
 (0)