|
Last change
on this file since ba17441 was e4c61dd, checked in by istevanoska <ilinastevanoska@…>, 6 months ago |
|
Prototype 1.1
|
-
Property mode
set to
100644
|
|
File size:
540 bytes
|
| Line | |
|---|
| 1 | import clipRectangle from "./rectangle.js";
|
|---|
| 2 |
|
|---|
| 3 | export default function() {
|
|---|
| 4 | var x0 = 0,
|
|---|
| 5 | y0 = 0,
|
|---|
| 6 | x1 = 960,
|
|---|
| 7 | y1 = 500,
|
|---|
| 8 | cache,
|
|---|
| 9 | cacheStream,
|
|---|
| 10 | clip;
|
|---|
| 11 |
|
|---|
| 12 | return clip = {
|
|---|
| 13 | stream: function(stream) {
|
|---|
| 14 | return cache && cacheStream === stream ? cache : cache = clipRectangle(x0, y0, x1, y1)(cacheStream = stream);
|
|---|
| 15 | },
|
|---|
| 16 | extent: function(_) {
|
|---|
| 17 | return arguments.length ? (x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1], cache = cacheStream = null, clip) : [[x0, y0], [x1, y1]];
|
|---|
| 18 | }
|
|---|
| 19 | };
|
|---|
| 20 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.