jsxgraph 1.4.0 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/distrib/README.md +1 -1
- package/distrib/geogebra.min.js +3 -3
- package/distrib/geonext.min.js +3 -3
- package/distrib/index.d.ts +650 -447
- package/distrib/intergeo.min.js +3 -3
- package/distrib/jsxgraph.css +4 -13
- package/distrib/jsxgraphcore.js +9 -25
- package/distrib/jsxgraphsrc.js +2544 -2060
- package/distrib/sketch.min.js +3 -3
- package/package.json +3 -2
- package/src/base/board.js +99 -59
- package/src/base/chart.js +1 -1
- package/src/base/circle.js +1 -1
- package/src/base/composition.js +1 -1
- package/src/base/constants.js +14 -14
- package/src/base/coords.js +3 -3
- package/src/base/coordselement.js +4 -4
- package/src/base/curve.js +1 -1
- package/src/base/element.js +13 -14
- package/src/base/foreignobject.js +5 -1
- package/src/base/group.js +1 -1
- package/src/base/image.js +1 -1
- package/src/base/line.js +1 -1
- package/src/base/point.js +7 -18
- package/src/base/polygon.js +1 -1
- package/src/base/text.js +8 -7
- package/src/base/ticks.js +9 -2
- package/src/base/transformation.js +1 -1
- package/src/base/turtle.js +1 -1
- package/src/element/arc.js +1 -1
- package/src/element/button.js +1 -1
- package/src/element/checkbox.js +1 -1
- package/src/element/comb.js +1 -1
- package/src/element/composition.js +1 -1
- package/src/element/conic.js +3 -3
- package/src/element/input.js +1 -1
- package/src/element/locus.js +1 -1
- package/src/element/measure.js +9 -4
- package/src/element/sector.js +5 -5
- package/src/element/slider.js +17 -12
- package/src/element/slopetriangle.js +1 -1
- package/src/jsxgraph.js +9 -3
- package/src/jxg.js +3 -3
- package/src/loadjsxgraph.js +1 -1
- package/src/math/bst.js +1 -1
- package/src/math/clip.js +550 -345
- package/src/math/complex.js +1 -1
- package/src/math/extrapolate.js +1 -1
- package/src/math/geometry.js +5 -5
- package/src/math/ia.js +69 -69
- package/src/math/math.js +1 -1
- package/src/math/metapost.js +1 -1
- package/src/math/nlp.js +4 -4
- package/src/math/numerics.js +2 -1
- package/src/math/plot.js +4 -4
- package/src/math/poly.js +1 -1
- package/src/math/probfuncs.js +2 -1
- package/src/math/qdt.js +11 -11
- package/src/math/statistics.js +10 -10
- package/src/math/symbolic.js +1 -1
- package/src/options.js +72 -31
- package/src/parser/ca.js +1297 -1291
- package/src/parser/datasource.js +1 -1
- package/src/parser/geonext.js +6 -6
- package/src/parser/jessiecode.js +266 -73
- package/src/parser/jessiescript.js +1 -1
- package/src/reader/cinderella.js +1 -1
- package/src/reader/file.js +1 -1
- package/src/reader/geogebra.js +1 -1
- package/src/reader/geonext.js +1 -1
- package/src/reader/graph.js +1 -1
- package/src/reader/intergeo.js +1 -1
- package/src/reader/sketch.js +1 -1
- package/src/renderer/abstract.js +4 -1
- package/src/renderer/canvas.js +9 -5
- package/src/renderer/no.js +2 -1
- package/src/renderer/svg.js +10 -13
- package/src/renderer/vml.js +1 -1
- package/src/server/server.js +1 -1
- package/src/utils/base64.js +2 -2
- package/src/utils/color.js +7 -7
- package/src/utils/dump.js +20 -5
- package/src/utils/env.js +13 -54
- package/src/utils/event.js +1 -1
- package/src/utils/expect.js +1 -1
- package/src/utils/type.js +10 -8
- package/src/utils/xml.js +1 -1
- package/src/utils/zip.js +1 -1
- package/CHANGELOG.md +0 -1366
package/src/base/board.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2008-
|
|
2
|
+
Copyright 2008-2022
|
|
3
3
|
Matthias Ehmann,
|
|
4
4
|
Michael Gerhaeuser,
|
|
5
5
|
Carsten Miller,
|
|
@@ -1213,7 +1213,7 @@ define([
|
|
|
1213
1213
|
op = (new Coords(Const.COORDS_BY_SCREEN, [moveEl.Xprev, moveEl.Yprev], this)).usrCoords;
|
|
1214
1214
|
// New finger position
|
|
1215
1215
|
np = (new Coords(Const.COORDS_BY_SCREEN, [moveEl.X, moveEl.Y], this)).usrCoords;
|
|
1216
|
-
|
|
1216
|
+
|
|
1217
1217
|
// Old and new directions
|
|
1218
1218
|
od = Mat.crossProduct(fix, op);
|
|
1219
1219
|
nd = Mat.crossProduct(fix, np);
|
|
@@ -1296,7 +1296,7 @@ define([
|
|
|
1296
1296
|
op = (new Coords(Const.COORDS_BY_SCREEN, [moveEl.Xprev, moveEl.Yprev], this)).usrCoords;
|
|
1297
1297
|
// New finger position
|
|
1298
1298
|
np = (new Coords(Const.COORDS_BY_SCREEN, [moveEl.X, moveEl.Y], this)).usrCoords;
|
|
1299
|
-
|
|
1299
|
+
|
|
1300
1300
|
alpha = Geometry.rad(op.slice(1), fix.slice(1), np.slice(1));
|
|
1301
1301
|
|
|
1302
1302
|
// Rotate and scale by the movement of the second finger
|
|
@@ -2161,7 +2161,7 @@ define([
|
|
|
2161
2161
|
type = this._inputDevice;
|
|
2162
2162
|
this.options.precision.hasPoint = this.options.precision[type];
|
|
2163
2163
|
|
|
2164
|
-
// Handling of multi touch with pointer events should be easier than the touch events.
|
|
2164
|
+
// Handling of multi touch with pointer events should be easier than the touch events.
|
|
2165
2165
|
// Every pointer device has its own pointerId, e.g. the mouse
|
|
2166
2166
|
// always has id 1 or 0, fingers and pens get unique ids every time a pointerDown event is fired and they will
|
|
2167
2167
|
// keep this id until a pointerUp event is fired. What we have to do here is:
|
|
@@ -2203,7 +2203,7 @@ define([
|
|
|
2203
2203
|
target = elements[elements.length - 1];
|
|
2204
2204
|
found = false;
|
|
2205
2205
|
|
|
2206
|
-
// Reminder: this.touches is the list of elements which
|
|
2206
|
+
// Reminder: this.touches is the list of elements which
|
|
2207
2207
|
// currently "possess" a pointer (mouse, pen, finger)
|
|
2208
2208
|
for (i = 0; i < this.touches.length; i++) {
|
|
2209
2209
|
// An element receives a further touch, i.e.
|
|
@@ -2257,10 +2257,11 @@ define([
|
|
|
2257
2257
|
|
|
2258
2258
|
// Touch events on empty areas of the board are handled here, see also touchStartListener
|
|
2259
2259
|
// 1. case: one finger. If allowed, this triggers pan with one finger
|
|
2260
|
-
if (evt.touches.length
|
|
2260
|
+
if (evt.touches.length === 1 &&
|
|
2261
2261
|
this.mode === this.BOARD_MODE_NONE &&
|
|
2262
2262
|
this.touchStartMoveOriginOneFinger(evt)) {
|
|
2263
|
-
|
|
2263
|
+
// Empty by purpose
|
|
2264
|
+
} else if (evt.touches.length === 2 &&
|
|
2264
2265
|
(this.mode === this.BOARD_MODE_NONE || this.mode === this.BOARD_MODE_MOVE_ORIGIN)
|
|
2265
2266
|
) {
|
|
2266
2267
|
// 2. case: two fingers: pinch to zoom or pan with two fingers needed.
|
|
@@ -2342,7 +2343,7 @@ define([
|
|
|
2342
2343
|
// Run through all touch events which have been started on this jsxgraph element.
|
|
2343
2344
|
for (j = 0; j < touchTargets.length; j++) {
|
|
2344
2345
|
if (touchTargets[j].num === evt.pointerId) {
|
|
2345
|
-
|
|
2346
|
+
|
|
2346
2347
|
pos = this.getMousePosition(evt);
|
|
2347
2348
|
touchTargets[j].X = pos[0];
|
|
2348
2349
|
touchTargets[j].Y = pos[1];
|
|
@@ -2582,7 +2583,7 @@ define([
|
|
|
2582
2583
|
Yprev: NaN,
|
|
2583
2584
|
Xstart: [],
|
|
2584
2585
|
Ystart: [],
|
|
2585
|
-
Zstart: []
|
|
2586
|
+
Zstart: []
|
|
2586
2587
|
};
|
|
2587
2588
|
|
|
2588
2589
|
if (Type.isPoint(obj) ||
|
|
@@ -2590,7 +2591,7 @@ define([
|
|
|
2590
2591
|
obj.type === Const.OBJECT_TYPE_TICKS ||
|
|
2591
2592
|
obj.type === Const.OBJECT_TYPE_IMAGE) {
|
|
2592
2593
|
// It's a point, so it's single touch, so we just push it to our touches
|
|
2593
|
-
targets = [
|
|
2594
|
+
targets = [obj];
|
|
2594
2595
|
|
|
2595
2596
|
// For the UNDO/REDO of object moves
|
|
2596
2597
|
this.saveStartPos(obj, targets[0]);
|
|
@@ -2670,8 +2671,8 @@ define([
|
|
|
2670
2671
|
* @returns {Boolean}
|
|
2671
2672
|
*/
|
|
2672
2673
|
touchMoveListener: function (evt) {
|
|
2673
|
-
var i, pos1, pos2,
|
|
2674
|
-
|
|
2674
|
+
var i, pos1, pos2,
|
|
2675
|
+
touchTargets,
|
|
2675
2676
|
evtTouches = evt[JXG.touchProperty];
|
|
2676
2677
|
|
|
2677
2678
|
if (!this.checkFrameRate(evt)) {
|
|
@@ -3189,7 +3190,7 @@ define([
|
|
|
3189
3190
|
sX = 1.1 * Type.evaluate(el.visProp.attractordistance);
|
|
3190
3191
|
sY = sX;
|
|
3191
3192
|
|
|
3192
|
-
if (Type.evaluate(el.visProp.attractorunit)
|
|
3193
|
+
if (Type.evaluate(el.visProp.attractorunit) === 'screen') {
|
|
3193
3194
|
sX /= this.unitX;
|
|
3194
3195
|
sY /= this.unitX;
|
|
3195
3196
|
}
|
|
@@ -3704,11 +3705,11 @@ define([
|
|
|
3704
3705
|
* // Shorter version:
|
|
3705
3706
|
* //somePoint = board.create('point', a, {name:'SomePoint',size:4});
|
|
3706
3707
|
* });
|
|
3707
|
-
*
|
|
3708
|
+
*
|
|
3708
3709
|
* })();
|
|
3709
3710
|
*
|
|
3710
3711
|
* </script><pre>
|
|
3711
|
-
*
|
|
3712
|
+
*
|
|
3712
3713
|
* @see JXG.Board#getScrCoordsOfMouse
|
|
3713
3714
|
* @see JXG.Board#getAllUnderMouse
|
|
3714
3715
|
*/
|
|
@@ -3830,7 +3831,7 @@ define([
|
|
|
3830
3831
|
addConditions: function (str) {
|
|
3831
3832
|
var term, m, left, right, name, el, property,
|
|
3832
3833
|
functions = [],
|
|
3833
|
-
plaintext = 'var el, x, y, c, rgbo;\n',
|
|
3834
|
+
// plaintext = 'var el, x, y, c, rgbo;\n',
|
|
3834
3835
|
i = str.indexOf('<data>'),
|
|
3835
3836
|
j = str.indexOf('<' + '/data>'),
|
|
3836
3837
|
|
|
@@ -3914,7 +3915,7 @@ define([
|
|
|
3914
3915
|
if (!Type.exists(this.elementsByName[name])) {
|
|
3915
3916
|
JXG.debug("debug conditions: |" + name + "| undefined");
|
|
3916
3917
|
} else {
|
|
3917
|
-
plaintext += "el = this.objects[\"" + el.id + "\"];\n";
|
|
3918
|
+
// plaintext += "el = this.objects[\"" + el.id + "\"];\n";
|
|
3918
3919
|
|
|
3919
3920
|
switch (property) {
|
|
3920
3921
|
case 'x':
|
|
@@ -4389,34 +4390,38 @@ define([
|
|
|
4389
4390
|
* @returns {JXG.Board} Reference to the board
|
|
4390
4391
|
*/
|
|
4391
4392
|
resizeContainer: function (canvasWidth, canvasHeight, dontset, dontSetBoundingBox) {
|
|
4392
|
-
var
|
|
4393
|
-
|
|
4394
|
-
|
|
4393
|
+
var box;
|
|
4394
|
+
// w, h, cx, cy;
|
|
4395
|
+
// box_act,
|
|
4396
|
+
// shift_x = 0,
|
|
4397
|
+
// shift_y = 0;
|
|
4395
4398
|
|
|
4396
4399
|
if (!dontSetBoundingBox) {
|
|
4397
|
-
box_act = this.getBoundingBox(); // This is the actual bounding box.
|
|
4400
|
+
// box_act = this.getBoundingBox(); // This is the actual bounding box.
|
|
4401
|
+
box = this.getBoundingBox(); // This is the actual bounding box.
|
|
4398
4402
|
}
|
|
4399
4403
|
|
|
4400
4404
|
this.canvasWidth = parseFloat(canvasWidth);
|
|
4401
4405
|
this.canvasHeight = parseFloat(canvasHeight);
|
|
4402
4406
|
|
|
4403
|
-
if (!dontSetBoundingBox) {
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
// The shift values compensate the follow-up correction
|
|
4407
|
-
// in setBoundingBox in case of "this.keepaspectratio==true"
|
|
4408
|
-
// Otherwise, shift_x and shift_y will be zero.
|
|
4409
|
-
shift_x = box_act[0] - box[0] / this.zoomX;
|
|
4410
|
-
shift_y = box_act[1] - box[1] / this.zoomY;
|
|
4407
|
+
// if (!dontSetBoundingBox) {
|
|
4408
|
+
// box = this.attr.boundingbox; // This is the intended bounding box.
|
|
4411
4409
|
|
|
4412
|
-
|
|
4413
|
-
|
|
4410
|
+
// // The shift values compensate the follow-up correction
|
|
4411
|
+
// // in setBoundingBox in case of "this.keepaspectratio==true"
|
|
4412
|
+
// // Otherwise, shift_x and shift_y will be zero.
|
|
4413
|
+
// // Obsolet since setBoundingBox centers in case of "this.keepaspectratio==true".
|
|
4414
|
+
// // shift_x = box_act[0] - box[0] / this.zoomX;
|
|
4415
|
+
// // shift_y = box_act[1] - box[1] / this.zoomY;
|
|
4414
4416
|
|
|
4415
|
-
|
|
4416
|
-
|
|
4417
|
+
// cx = (box[2] + box[0]) * 0.5; // + shift_x;
|
|
4418
|
+
// cy = (box[3] + box[1]) * 0.5; // + shift_y;
|
|
4417
4419
|
|
|
4418
|
-
|
|
4419
|
-
|
|
4420
|
+
// w = (box[2] - box[0]) * 0.5 / this.zoomX;
|
|
4421
|
+
// h = (box[1] - box[3]) * 0.5 / this.zoomY;
|
|
4422
|
+
|
|
4423
|
+
// box = [cx - w, cy + h, cx + w, cy - h];
|
|
4424
|
+
// }
|
|
4420
4425
|
|
|
4421
4426
|
if (!dontset) {
|
|
4422
4427
|
this.containerObj.style.width = (this.canvasWidth) + 'px';
|
|
@@ -4532,7 +4537,7 @@ define([
|
|
|
4532
4537
|
|
|
4533
4538
|
for (el = 0; el < this.objectsList.length; el++) {
|
|
4534
4539
|
pEl = this.objectsList[el];
|
|
4535
|
-
if (this.needsFullUpdate && pEl.elementClass
|
|
4540
|
+
if (this.needsFullUpdate && pEl.elementClass === Const.OBJECT_CLASS_TEXT) {
|
|
4536
4541
|
pEl.updateSize();
|
|
4537
4542
|
}
|
|
4538
4543
|
|
|
@@ -4919,11 +4924,14 @@ define([
|
|
|
4919
4924
|
*/
|
|
4920
4925
|
setBoundingBox: function (bbox, keepaspectratio, setZoom) {
|
|
4921
4926
|
var h, w, ux, uy,
|
|
4927
|
+
offX = 0,
|
|
4928
|
+
offY = 0,
|
|
4922
4929
|
dim = Env.getDimensions(this.container, this.document);
|
|
4923
4930
|
|
|
4924
4931
|
if (!Type.isArray(bbox)) {
|
|
4925
4932
|
return this;
|
|
4926
4933
|
}
|
|
4934
|
+
|
|
4927
4935
|
if (bbox[0] < this.maxboundingbox[0] ||
|
|
4928
4936
|
bbox[1] > this.maxboundingbox[1] ||
|
|
4929
4937
|
bbox[2] > this.maxboundingbox[2] ||
|
|
@@ -4942,14 +4950,17 @@ define([
|
|
|
4942
4950
|
this.canvasHeight = parseInt(dim.height, 10);
|
|
4943
4951
|
w = this.canvasWidth;
|
|
4944
4952
|
h = this.canvasHeight;
|
|
4945
|
-
|
|
4946
4953
|
if (keepaspectratio) {
|
|
4947
4954
|
this.unitX = w / (bbox[2] - bbox[0]);
|
|
4948
4955
|
this.unitY = h / (bbox[1] - bbox[3]);
|
|
4949
4956
|
if (Math.abs(this.unitX) < Math.abs(this.unitY)) {
|
|
4950
4957
|
this.unitY = Math.abs(this.unitX) * this.unitY / Math.abs(this.unitY);
|
|
4958
|
+
// Add the additional units in equal portions above and below
|
|
4959
|
+
offY = (h / this.unitY - (bbox[1] - bbox[3])) * 0.5;
|
|
4951
4960
|
} else {
|
|
4952
4961
|
this.unitX = Math.abs(this.unitY) * this.unitX / Math.abs(this.unitX);
|
|
4962
|
+
// Add the additional units in equal portions left and right
|
|
4963
|
+
offX = (w / this.unitX - (bbox[2] - bbox[0])) * 0.5;
|
|
4953
4964
|
}
|
|
4954
4965
|
this.keepaspectratio = true;
|
|
4955
4966
|
} else {
|
|
@@ -4957,8 +4968,8 @@ define([
|
|
|
4957
4968
|
this.unitY = h / (bbox[1] - bbox[3]);
|
|
4958
4969
|
this.keepaspectratio = false;
|
|
4959
4970
|
}
|
|
4960
|
-
|
|
4961
|
-
this.moveOrigin(-this.unitX * bbox[0], this.unitY * bbox[1]);
|
|
4971
|
+
|
|
4972
|
+
this.moveOrigin(-this.unitX * (bbox[0] - offX), this.unitY * (bbox[1] + offY));
|
|
4962
4973
|
|
|
4963
4974
|
if (setZoom === 'update') {
|
|
4964
4975
|
this.zoomX *= this.unitX / ux;
|
|
@@ -5849,6 +5860,8 @@ define([
|
|
|
5849
5860
|
* <p>
|
|
5850
5861
|
* The wrapping div has the CSS class 'jxgbox_wrap_private' which is
|
|
5851
5862
|
* defined in the file 'jsxgraph.css'
|
|
5863
|
+
* <p>
|
|
5864
|
+
* This feature is not available on iPhones (as of December 2021).
|
|
5852
5865
|
*
|
|
5853
5866
|
* @param {String} id (Optional) id of the div element which is brought to fullscreen.
|
|
5854
5867
|
* If not provided, this defaults to the JSXGraph div. However, it may be necessary for the aspect ratio trick
|
|
@@ -5912,28 +5925,38 @@ define([
|
|
|
5912
5925
|
*
|
|
5913
5926
|
*
|
|
5914
5927
|
*/
|
|
5915
|
-
toFullscreen: function(id) {
|
|
5928
|
+
toFullscreen: function (id) {
|
|
5916
5929
|
var wrap_id, wrap_node, inner_node;
|
|
5917
5930
|
|
|
5918
5931
|
id = id || this.container;
|
|
5919
|
-
|
|
5920
5932
|
this._fullscreen_inner_id = id;
|
|
5921
|
-
// inner_node = this.containerObj;
|
|
5922
5933
|
inner_node = document.getElementById(id);
|
|
5923
|
-
|
|
5924
5934
|
wrap_id = 'fullscreenwrap_' + id;
|
|
5925
|
-
wrap_node = document.createElement('div');
|
|
5926
5935
|
|
|
5927
|
-
//
|
|
5928
|
-
if (
|
|
5936
|
+
// Wrap a div around the JSXGraph div.
|
|
5937
|
+
if (this.document.getElementById(wrap_id)) {
|
|
5938
|
+
wrap_node = this.document.getElementById(wrap_id);
|
|
5939
|
+
} else {
|
|
5940
|
+
wrap_node = document.createElement('div');
|
|
5929
5941
|
wrap_node.classList.add('JXG_wrap_private');
|
|
5930
5942
|
wrap_node.setAttribute('id', wrap_id);
|
|
5931
5943
|
inner_node.parentNode.insertBefore(wrap_node, inner_node);
|
|
5932
5944
|
wrap_node.appendChild(inner_node);
|
|
5933
5945
|
}
|
|
5934
5946
|
|
|
5935
|
-
//
|
|
5936
|
-
|
|
5947
|
+
// Get the real width and height of the JSXGraph div
|
|
5948
|
+
// and determine the scaling and vertical shift amount
|
|
5949
|
+
this._fullscreen_res = Env._getScaleFactors(inner_node);
|
|
5950
|
+
|
|
5951
|
+
// Trigger fullscreen mode
|
|
5952
|
+
wrap_node.requestFullscreen = wrap_node.requestFullscreen ||
|
|
5953
|
+
wrap_node.webkitRequestFullscreen ||
|
|
5954
|
+
wrap_node.mozRequestFullScreen ||
|
|
5955
|
+
wrap_node.msRequestFullscreen;
|
|
5956
|
+
|
|
5957
|
+
if (wrap_node.requestFullscreen) {
|
|
5958
|
+
wrap_node.requestFullscreen();
|
|
5959
|
+
}
|
|
5937
5960
|
|
|
5938
5961
|
return this;
|
|
5939
5962
|
},
|
|
@@ -5945,7 +5968,7 @@ define([
|
|
|
5945
5968
|
*
|
|
5946
5969
|
* @param {Object} evt fullscreen event object (unused)
|
|
5947
5970
|
*/
|
|
5948
|
-
fullscreenListener: function(evt) {
|
|
5971
|
+
fullscreenListener: function (evt) {
|
|
5949
5972
|
var res, inner_id, inner_node;
|
|
5950
5973
|
|
|
5951
5974
|
inner_id = this._fullscreen_inner_id;
|
|
@@ -5953,20 +5976,20 @@ define([
|
|
|
5953
5976
|
return;
|
|
5954
5977
|
}
|
|
5955
5978
|
|
|
5979
|
+
document.fullscreenElement = document.fullscreenElement ||
|
|
5980
|
+
document.webkitFullscreenElement ||
|
|
5981
|
+
document.mozFullscreenElement ||
|
|
5982
|
+
document.msFullscreenElement;
|
|
5983
|
+
|
|
5956
5984
|
inner_node = document.getElementById(inner_id);
|
|
5957
5985
|
// If full screen mode is started we have to remove CSS margin around the JSXGraph div.
|
|
5958
5986
|
// Otherwise, the positioning of the fullscreen div will be false.
|
|
5959
5987
|
// When leaving the fullscreen mode, the margin is put back in.
|
|
5960
5988
|
if (document.fullscreenElement) {
|
|
5961
|
-
//
|
|
5989
|
+
// Just entered fullscreen mode
|
|
5962
5990
|
|
|
5963
|
-
|
|
5964
|
-
|
|
5965
|
-
// Do the shifting and scaling via CSS pseudo rules
|
|
5966
|
-
// We do this after fullscreen mode has been established to get the correct size
|
|
5967
|
-
// of the JSXGraph div
|
|
5968
|
-
res = Env._getScaleFactors(inner_node);
|
|
5969
|
-
Env.scaleJSXGraphDiv(document.fullscreenElement.id, inner_id, res.scale, res.vshift);
|
|
5991
|
+
// Get the data computed in board.toFullscreen()
|
|
5992
|
+
res = this._fullscreen_res;
|
|
5970
5993
|
|
|
5971
5994
|
// Store the scaling data.
|
|
5972
5995
|
// It is used in AbstractRenderer.updateText to restore the scaling matrix
|
|
@@ -5977,11 +6000,25 @@ define([
|
|
|
5977
6000
|
id: document.fullscreenElement.id,
|
|
5978
6001
|
isFullscreen: true,
|
|
5979
6002
|
margin: inner_node.style.margin,
|
|
5980
|
-
|
|
6003
|
+
width: inner_node.style.width,
|
|
6004
|
+
scale: res.scale,
|
|
5981
6005
|
vshift: res.vshift
|
|
5982
6006
|
};
|
|
6007
|
+
|
|
6008
|
+
inner_node.style.margin = '';
|
|
6009
|
+
inner_node.style.width = res.width + 'px';
|
|
6010
|
+
|
|
6011
|
+
// Do the shifting and scaling via CSS pseudo rules
|
|
6012
|
+
// We do this after fullscreen mode has been established to get the correct size
|
|
6013
|
+
// of the JSXGraph div.
|
|
6014
|
+
Env.scaleJSXGraphDiv(document.fullscreenElement.id, inner_id, res.scale, res.vshift);
|
|
6015
|
+
|
|
6016
|
+
// Clear document.fullscreenElement, because Safari doesn't to it and
|
|
6017
|
+
// when leaving full screen mode it is still set.
|
|
6018
|
+
document.fullscreenElement = null;
|
|
6019
|
+
|
|
5983
6020
|
} else if (Type.exists(inner_node._cssFullscreenStore)) {
|
|
5984
|
-
//
|
|
6021
|
+
// Just left the fullscreen mode
|
|
5985
6022
|
|
|
5986
6023
|
// Remove the CSS rules added in Env.scaleJSXGraphDiv
|
|
5987
6024
|
try {
|
|
@@ -5989,8 +6026,11 @@ define([
|
|
|
5989
6026
|
} catch (err) {
|
|
5990
6027
|
console.log('JSXGraph: Could not remove CSS rules for full screen mode');
|
|
5991
6028
|
}
|
|
6029
|
+
|
|
5992
6030
|
inner_node._cssFullscreenStore.isFullscreen = false;
|
|
5993
6031
|
inner_node.style.margin = inner_node._cssFullscreenStore.margin;
|
|
6032
|
+
inner_node.style.width = inner_node._cssFullscreenStore.width;
|
|
6033
|
+
|
|
5994
6034
|
}
|
|
5995
6035
|
|
|
5996
6036
|
this.updateCSSTransforms();
|
package/src/base/chart.js
CHANGED
package/src/base/circle.js
CHANGED
package/src/base/composition.js
CHANGED
package/src/base/constants.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2008-
|
|
2
|
+
Copyright 2008-2022
|
|
3
3
|
Matthias Ehmann,
|
|
4
4
|
Michael Gerhaeuser,
|
|
5
5
|
Carsten Miller,
|
|
@@ -42,7 +42,7 @@ define(['jxg'], function (JXG) {
|
|
|
42
42
|
|
|
43
43
|
var major = 1,
|
|
44
44
|
minor = 4,
|
|
45
|
-
patch =
|
|
45
|
+
patch = 1,
|
|
46
46
|
add = '', //'dev'
|
|
47
47
|
version = major + '.' + minor + '.' + patch + (add ? '-' + add : ''),
|
|
48
48
|
constants;
|
|
@@ -132,16 +132,16 @@ define(['jxg'], function (JXG) {
|
|
|
132
132
|
GENTYPE_AXIS: 2,
|
|
133
133
|
GENTYPE_MID: 3,
|
|
134
134
|
|
|
135
|
-
/**
|
|
135
|
+
/**
|
|
136
136
|
* @ignore
|
|
137
|
-
* @deprecated, now use {@link JXG.GENTYPE_REFLECTION_ON_LINE}
|
|
138
|
-
*
|
|
139
|
-
*/
|
|
137
|
+
* @deprecated, now use {@link JXG.GENTYPE_REFLECTION_ON_LINE}
|
|
138
|
+
*
|
|
139
|
+
*/
|
|
140
140
|
GENTYPE_REFLECTION: 4,
|
|
141
|
-
/**
|
|
142
|
-
* @ignore
|
|
143
|
-
* @deprecated, now use {@link JXG.GENTYPE_REFLECTION_ON_POINT}
|
|
144
|
-
*/
|
|
141
|
+
/**
|
|
142
|
+
* @ignore
|
|
143
|
+
* @deprecated, now use {@link JXG.GENTYPE_REFLECTION_ON_POINT}
|
|
144
|
+
*/
|
|
145
145
|
GENTYPE_MIRRORELEMENT: 5,
|
|
146
146
|
|
|
147
147
|
GENTYPE_REFLECTION_ON_LINE: 4,
|
|
@@ -156,9 +156,9 @@ define(['jxg'], function (JXG) {
|
|
|
156
156
|
GENTYPE_GLIDER: 13,
|
|
157
157
|
GENTYPE_INTERSECTION: 14,
|
|
158
158
|
GENTYPE_CIRCLE: 15,
|
|
159
|
-
/**
|
|
160
|
-
* @ignore @deprecated NOT USED ANY MORE SINCE SKETCHOMETRY 2.0 (only for old constructions needed)
|
|
161
|
-
*/
|
|
159
|
+
/**
|
|
160
|
+
* @ignore @deprecated NOT USED ANY MORE SINCE SKETCHOMETRY 2.0 (only for old constructions needed)
|
|
161
|
+
*/
|
|
162
162
|
GENTYPE_CIRCLE2POINTS: 16,
|
|
163
163
|
|
|
164
164
|
GENTYPE_LINE: 17,
|
|
@@ -197,7 +197,7 @@ define(['jxg'], function (JXG) {
|
|
|
197
197
|
* @name Constants
|
|
198
198
|
* @namespace
|
|
199
199
|
*/
|
|
200
|
-
|
|
200
|
+
|
|
201
201
|
// GENTYPE_TRANSFORM: 48, // unused
|
|
202
202
|
// 49 ... 50 // unused ...
|
|
203
203
|
|
package/src/base/coords.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2008-
|
|
2
|
+
Copyright 2008-2022
|
|
3
3
|
Matthias Ehmann,
|
|
4
4
|
Michael Gerhaeuser,
|
|
5
5
|
Carsten Miller,
|
|
@@ -234,11 +234,11 @@ define([
|
|
|
234
234
|
},
|
|
235
235
|
|
|
236
236
|
/**
|
|
237
|
-
* Copy array, either
|
|
237
|
+
* Copy array, either scrCoords or usrCoords
|
|
238
238
|
* Uses slice() in case of standard arrays and set() in case of
|
|
239
239
|
* typed arrays.
|
|
240
240
|
* @private
|
|
241
|
-
* @param {String} obj Either '
|
|
241
|
+
* @param {String} obj Either 'scrCoords' or 'usrCoords'
|
|
242
242
|
* @param {Number} offset Offset, defaults to 0 if not given
|
|
243
243
|
* @returns {Array} Returns copy of the coords array either as standard array or as
|
|
244
244
|
* typed array.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2008-
|
|
2
|
+
Copyright 2008-2022
|
|
3
3
|
Matthias Ehmann,
|
|
4
4
|
Michael Gerhaeuser,
|
|
5
5
|
Carsten Miller,
|
|
@@ -260,7 +260,7 @@ define([
|
|
|
260
260
|
ev_sw,
|
|
261
261
|
slide = this.slideObject,
|
|
262
262
|
res, cu,
|
|
263
|
-
slides = [],
|
|
263
|
+
slides = [],
|
|
264
264
|
isTransformed;
|
|
265
265
|
|
|
266
266
|
this.needsUpdateFromParent = false;
|
|
@@ -1098,8 +1098,8 @@ define([
|
|
|
1098
1098
|
slide = slideobj.borders[i];
|
|
1099
1099
|
}
|
|
1100
1100
|
}
|
|
1101
|
-
|
|
1102
|
-
|
|
1101
|
+
slideobj = this.board.select(slide);
|
|
1102
|
+
onPolygon = true;
|
|
1103
1103
|
}
|
|
1104
1104
|
|
|
1105
1105
|
/* Gliders on Ticks are forbidden */
|
package/src/base/curve.js
CHANGED
package/src/base/element.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2008-
|
|
2
|
+
Copyright 2008-2022
|
|
3
3
|
Matthias Ehmann,
|
|
4
4
|
Michael Gerhaeuser,
|
|
5
5
|
Carsten Miller,
|
|
@@ -1927,10 +1927,9 @@ define([
|
|
|
1927
1927
|
*/
|
|
1928
1928
|
removeAllTicks: function () {
|
|
1929
1929
|
var t;
|
|
1930
|
-
|
|
1931
1930
|
if (Type.exists(this.ticks)) {
|
|
1932
|
-
for (t = this.ticks.length; t
|
|
1933
|
-
this.removeTicks(this.ticks[t
|
|
1931
|
+
for (t = this.ticks.length - 1; t >= 0; t--) {
|
|
1932
|
+
this.removeTicks(this.ticks[t]);
|
|
1934
1933
|
}
|
|
1935
1934
|
this.ticks = [];
|
|
1936
1935
|
this.board.update();
|
|
@@ -1949,19 +1948,19 @@ define([
|
|
|
1949
1948
|
}
|
|
1950
1949
|
|
|
1951
1950
|
if (Type.exists(this.ticks)) {
|
|
1952
|
-
for (t = this.ticks.length; t
|
|
1953
|
-
if (this.ticks[t
|
|
1954
|
-
this.board.removeObject(this.ticks[t
|
|
1955
|
-
|
|
1956
|
-
if (this.ticks[t
|
|
1957
|
-
for (j = 0; j < this.ticks[t
|
|
1958
|
-
if (Type.exists(this.ticks[t
|
|
1959
|
-
this.board.removeObject(this.ticks[t
|
|
1951
|
+
for (t = this.ticks.length - 1; t >= 0; t--) {
|
|
1952
|
+
if (this.ticks[t] === tick) {
|
|
1953
|
+
this.board.removeObject(this.ticks[t]);
|
|
1954
|
+
|
|
1955
|
+
if (this.ticks[t].ticks) {
|
|
1956
|
+
for (j = 0; j < this.ticks[t].ticks.length; j++) {
|
|
1957
|
+
if (Type.exists(this.ticks[t].labels[j])) {
|
|
1958
|
+
this.board.removeObject(this.ticks[t].labels[j]);
|
|
1960
1959
|
}
|
|
1961
1960
|
}
|
|
1962
1961
|
}
|
|
1963
1962
|
|
|
1964
|
-
delete this.ticks[t
|
|
1963
|
+
delete this.ticks[t];
|
|
1965
1964
|
break;
|
|
1966
1965
|
}
|
|
1967
1966
|
}
|
|
@@ -2034,7 +2033,7 @@ define([
|
|
|
2034
2033
|
rcoords = new JXG.Coords(Const.COORDS_BY_USER, [rx, ry], this.board);
|
|
2035
2034
|
if (!attractToGrid ||
|
|
2036
2035
|
rcoords.distance(
|
|
2037
|
-
ev_au
|
|
2036
|
+
ev_au === 'screen' ? Const.COORDS_BY_SCREEN : Const.COORDS_BY_USER, this.coords
|
|
2038
2037
|
) < ev_ad) {
|
|
2039
2038
|
x = rx;
|
|
2040
2039
|
y = ry;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2008-
|
|
2
|
+
Copyright 2008-2022
|
|
3
3
|
Matthias Ehmann,
|
|
4
4
|
Michael Gerhaeuser,
|
|
5
5
|
Carsten Miller,
|
|
@@ -427,6 +427,10 @@
|
|
|
427
427
|
*
|
|
428
428
|
* </script><pre>
|
|
429
429
|
*
|
|
430
|
+
* Video "24-hour time-lapse in Cascais, Portugal. Produced by Nuno Miguel Duarte" adapted from
|
|
431
|
+
* <a href="https://www.pbslearningmedia.org/resource/buac18-k2-sci-ess-sunposition/changing-position-of-the-sun-in-the-sky/">https://www.pbslearningmedia.org/resource/buac18-k2-sci-ess-sunposition/changing-position-of-the-sun-in-the-sky/</a>,
|
|
432
|
+
* ©2016 Nuno Miguel Duarte.
|
|
433
|
+
*
|
|
430
434
|
*/
|
|
431
435
|
JXG.createForeignObject = function (board, parents, attributes) {
|
|
432
436
|
var attr, fo,
|
package/src/base/group.js
CHANGED
package/src/base/image.js
CHANGED
package/src/base/line.js
CHANGED