2013-06-12 19:50:24 -04:00
|
|
|
/*
|
|
|
|
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
|
|
|
|
* http://paperjs.org/
|
|
|
|
*
|
2020-05-23 16:24:42 -04:00
|
|
|
* Copyright (c) 2011 - 2020, Jürg Lehni & Jonathan Puckey
|
|
|
|
* http://juerglehni.com/ & https://puckey.studio/
|
2013-06-12 19:50:24 -04:00
|
|
|
*
|
|
|
|
* Distributed under the MIT license. See LICENSE file for details.
|
|
|
|
*
|
|
|
|
* All rights reserved.
|
|
|
|
*/
|
|
|
|
|
2016-01-27 13:57:07 -05:00
|
|
|
QUnit.module('TextItem');
|
2013-06-12 19:50:24 -04:00
|
|
|
|
|
|
|
test('PointText', function() {
|
2014-08-16 13:24:54 -04:00
|
|
|
var text = new PointText({
|
2016-01-27 18:30:38 -05:00
|
|
|
fontFamily: 'Arial, Helvetica',
|
2014-08-16 13:24:54 -04:00
|
|
|
fontSize: 14,
|
|
|
|
point: [100, 100],
|
|
|
|
content: 'Hello World!'
|
|
|
|
});
|
2014-12-28 09:21:38 -05:00
|
|
|
equals(text.fillColor, new Color(0, 0, 0), 'text.fillColor should be black by default');
|
2014-12-28 08:59:48 -05:00
|
|
|
equals(text.point, new Point(100, 100), 'text.point');
|
2016-01-27 18:30:38 -05:00
|
|
|
equals(text.bounds, new Rectangle(100, 87.4, 76.25, 16.8), 'text.bounds', { tolerance: 1.0 });
|
2014-08-16 13:24:54 -04:00
|
|
|
equals(function() {
|
|
|
|
return text.hitTest(text.bounds.center) != null;
|
|
|
|
}, true);
|
2013-06-12 19:50:24 -04:00
|
|
|
});
|