Rename app.file.cursor to app.file.textCursor.

Signed-off-by: Gökay Şatır <gokaysatir@gmail.com>
Change-Id: Ic81a775efb6592e81f52e8b2a6789ac5a90c761c
pull/8909/head
Gökay Şatır 2024-04-19 12:24:20 +03:00 committed by Gökay ŞATIR
parent fa6d8f6dde
commit 95d1b6d3ca
4 changed files with 9 additions and 9 deletions

View File

@ -44,7 +44,7 @@ window.app = {
readOnly: true,
permission: 'readonly',
disableSidebar: false,
cursor: {
textCursor: {
visible: false,
/*
@ -53,7 +53,7 @@ window.app = {
One should consider this as a document object coordinate as in CanvasSectionContainer.
This gives the coordinate relative to the document, not relative to the UI.
*/
rectangle: null
rectangle: null // SimpleRectangle.
},
size: {
pixels: [0, 0], // This can change according to the zoom level and document's size.

View File

@ -26,7 +26,7 @@ window.addEventListener('load', function () {
app.calc.splitCoordinate = new app.definitions.simplePoint(0, 0);
app.canvasSize = new app.definitions.simplePoint(0, 0);
app.file.viewedRectangle = new app.definitions.simpleRectangle(0, 0, 0, 0);
app.file.cursor.rectangle = new app.definitions.simpleRectangle(0, 0, 0, 0);
app.file.textCursor.rectangle = new app.definitions.simpleRectangle(0, 0, 0, 0);
});
app.isReadOnly = function () {

View File

@ -1010,7 +1010,7 @@ class CanvasSectionContainer {
for (var j: number = 0; j < this.windowSectionList.length; j++) {
var windowSection = this.windowSectionList[j];
if (windowSection.interactable)
windowSection.onCursorPositionChanged(app.file.cursor.rectangle.clone());
windowSection.onCursorPositionChanged(app.file.textCursor.rectangle.clone());
if (this.lowestPropagatedBoundSection === windowSection.name)
propagate = false; // Window sections can not stop the propagation of the event for other window sections.
@ -1019,7 +1019,7 @@ class CanvasSectionContainer {
if (propagate) {
for (var i: number = this.sections.length - 1; i > -1; i--) {
if (this.sections[i].interactable)
this.sections[i].onCursorPositionChanged(app.file.cursor.rectangle.clone());
this.sections[i].onCursorPositionChanged(app.file.textCursor.rectangle.clone());
}
}
}
@ -1339,7 +1339,7 @@ class CanvasSectionContainer {
*/
public onCursorPositionChanged() {
if (app.map._docLayer._docType === 'text') {
// Global state holder should already have the latest information: app.file.cursor.rectangle.
// Global state holder should already have the latest information: app.file.textCursor.rectangle.
this.propagateCursorPositionChanged();
}
}

View File

@ -2119,14 +2119,14 @@ L.CanvasTileLayer = L.Layer.extend({
_onCursorVisibleMsg: function(textMsg) {
var command = textMsg.match('cursorvisible: true');
this._map._isCursorVisible = command ? true : false;
app.file.cursor.visible = this._map.isCursorVisible;
app.file.textCursor.visible = this._map.isCursorVisible;
this._removeSelection();
this._onUpdateCursor();
},
_setCursorVisible: function() {
this._map._isCursorVisible = true;
app.file.cursor.visible = true;
app.file.textCursor.visible = true;
},
_onDownloadAsMsg: function (textMsg) {
@ -2722,7 +2722,7 @@ L.CanvasTileLayer = L.Layer.extend({
this._twipsToLatLng(recCursor.getBottomRight(), this._map.getZoom()));
this._cursorCorePixels = this._twipsToCorePixelsBounds(recCursor);
app.file.cursor.rectangle = new app.definitions.simpleRectangle(recCursor.getTopLeft().x, recCursor.getTopLeft().y, recCursor.getSize().x, recCursor.getSize().y);
app.file.textCursor.rectangle = new app.definitions.simpleRectangle(recCursor.getTopLeft().x, recCursor.getTopLeft().y, recCursor.getSize().x, recCursor.getSize().y);
if (this._docType === 'text') {
app.sectionContainer.onCursorPositionChanged();