2013-06-12 16:50:24 -07:00
|
|
|
/*
|
|
|
|
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
|
|
|
|
* http://paperjs.org/
|
|
|
|
*
|
2015-12-27 18:09:25 +01:00
|
|
|
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
|
2014-01-04 01:47:16 +01:00
|
|
|
* http://scratchdisk.com/ & http://jonathanpuckey.com/
|
2013-06-12 16:50:24 -07:00
|
|
|
*
|
|
|
|
* Distributed under the MIT license. See LICENSE file for details.
|
|
|
|
*
|
|
|
|
* All rights reserved.
|
|
|
|
*/
|
|
|
|
|
2016-01-27 19:57:07 +01:00
|
|
|
QUnit.module('TextItem');
|
2013-06-12 16:50:24 -07:00
|
|
|
|
|
|
|
test('PointText', function() {
|
2014-08-16 19:24:54 +02:00
|
|
|
var text = new PointText({
|
2015-09-06 12:33:41 +02:00
|
|
|
fontFamily: 'Helvetica, Arial',
|
2014-08-16 19:24:54 +02:00
|
|
|
fontSize: 14,
|
|
|
|
point: [100, 100],
|
|
|
|
content: 'Hello World!'
|
|
|
|
});
|
2014-12-28 15:21:38 +01:00
|
|
|
equals(text.fillColor, new Color(0, 0, 0), 'text.fillColor should be black by default');
|
2014-12-28 14:59:48 +01:00
|
|
|
equals(text.point, new Point(100, 100), 'text.point');
|
|
|
|
equals(text.bounds.point, new Point(100, 87.4), 'text.bounds.point');
|
2015-09-06 12:33:41 +02:00
|
|
|
equals(text.bounds.size, new Size(76, 16.8), 'text.bounds.size', { tolerance: 1.0 });
|
2014-08-16 19:24:54 +02:00
|
|
|
equals(function() {
|
|
|
|
return text.hitTest(text.bounds.center) != null;
|
|
|
|
}, true);
|
2013-06-12 16:50:24 -07:00
|
|
|
});
|