Commit Graph

25 Commits

Author SHA1 Message Date
Per Liedman
d9846d106b Round pan offset towards zero (#5858)
* Add Point.trunc/_trunc

* Truncate pan offset instead of flooring

Fixes #5821
2017-10-26 15:35:35 +03:00
Fabrizio
d9655a1e9a Change Util.formatNum default to 6 decimals (#5492)
* Util.formatNum default to 6

Changed Util.formaNum default to 6 decimails.
Solved 0 decimals bug.
Added tests.
Can be useful for PR #5444

* Changed documentation

Changed documentation to 6 instead of 5
2017-10-02 18:36:59 +02:00
ghybs
f677f9c6d2 Feat(Bounds): add new methods for 2 missing corners (#5488)
* Feat(Bounds): add getTopLeft & getBottomRight methods

as suggested in #5475, for consistency with `LatLngBounds` methods which already provide methods for the 4 possible corners.
Also include the docstrings.

* Docs(Bounds): add comments to identify corners

in BoundsSpec.

* Test(Bounds): add tests for existing corner methods

namely getBottomLeft and getTopRight.
Checked that expecting different values make the tests fail.

* Test(Bounds): add spec for 2 new corner methods

namely getTopLeft and getBottomRight.
Closes #5475 together with previous PR #5487.

* Refactor(Bounds): return this.min(max) instead of new Point

as TopLeft corner is tha same as this.min (BottomRight same as this.max).

* Docs(Bounds): add links to this.min(max)

to make it clearer that these methods are just shorthands to already available properties.
Furthermore, it implies that they output those properties directly, making a clue for the app developer that if he/she wants to modify them, they should be cloned before doing so in order to prevent unintentional behaviour.
2017-05-11 22:24:15 +02:00
Markus
3ac37c29a4 Add L.transformation factory, allow creation from array (#5282)
* added transformation getter

* fixed lint, added editorconfig

* added CRS.Simple transformation values again

* removed editorconfig
2017-01-30 09:43:50 +01:00
Nathan Cahill
1eafc015c1 create points from objects with x and y properties (#4465) 2016-04-20 17:05:31 +02:00
Vladimir Agafonkin
8c8d0ac7ee fix whitespace in comments 2015-09-25 15:37:07 +03:00
Vladimir Agafonkin
cfdbd10431 enforce indentation in specs 2015-09-25 13:55:37 +03:00
John Firebaugh
e52c551652 Remove trailing whitespace 2015-02-06 16:36:27 -08:00
Alexander Parshin
3a5d45d62e Add optional parameter for result rounding in L.PolyUtil.clipPolygon and L.LineUtil.clipSegment 2014-09-30 09:57:53 +04:00
Vladimir Agafonkin
5d4e77627a fix PolyUtil spec (we now round poly clipping) 2013-12-18 14:56:23 -05:00
Vladimir Agafonkin
91c039b7aa jshinting and major clean up of specs code, ref #2151 2013-11-07 23:54:33 +02:00
Tom MacWright
a2f7d7e834 Use mocha 2013-04-03 14:50:09 -07:00
Vladimir Agafonkin
9c2e7cfbd4 add Point contains method 2013-02-22 17:28:55 +02:00
John Firebaugh
01332ebead Omit "should" in spec descriptions
The rationale is this: the spec string describes the expected
behavior unconditionally. The code examples, on the other hand,
set up an expectation that is tested with the call to the expect
method. The code examples can violate the expectation, but the
spec string does not. The value of the spec string is as clearly
as possible describing the behavior. Including “should” in that
description adds no value. (From http://rubyspec.org/style_guide/)
2013-02-19 12:41:48 -08:00
Vladimir Agafonkin
17cf297c9b complete geometry tests to 100% #1347 2013-02-05 13:51:27 +02:00
Dominik Moritz
f8d6e7052e Implemented isValid() function for Bounds and LatLngBounds. Fixes issue #966. Added specification. 2012-09-11 12:43:16 +01:00
Andrey Rublev
9479911e69 Fix Bounds.contains method in case if obj argument is instance of L.Point 2011-07-13 18:13:35 +07:00
mourner
a2d2fed2db new Point methods 2010-09-17 19:04:41 +03:00
mourner
b6ead1dbf2 Transformation fix 2010-09-15 16:45:16 +03:00
mourner
06d043853d multiplyBy 2010-09-15 16:45:02 +03:00
mourner
c958de9721 Bounds with specs 2010-09-13 14:58:28 +03:00
mourner
59a1736b3e Point fixes 2010-09-13 14:58:03 +03:00
mourner
a8d55d0d47 Point add/subtract/divideBy 2010-09-10 16:54:03 +03:00
mourner
e1efc0c93f Moved Transformation to geometry 2010-09-03 15:38:14 +03:00
mourner
7a1dcd9915 Transformation & Point classes, more specs 2010-09-02 18:23:53 +03:00