mirror of
https://github.com/vrtmrz/ninja-cursor.git
synced 2026-07-22 06:40:31 +00:00
fixed:
- No longer corrupted with an empty text field.
This commit is contained in:
parent
2e25300def
commit
24c8a3b56a
4 changed files with 6 additions and 5 deletions
3
main.ts
3
main.ts
|
|
@ -80,7 +80,8 @@ class NinjaCursorForWindow {
|
|||
textRange.setEndAfter(range.startContainer);
|
||||
let textRect = textRange.getBoundingClientRect();
|
||||
if (textRect.x == 0 && textRect.y == 0) {
|
||||
textRange.setStart(range.endContainer, range.endOffset - 1);
|
||||
const startEndOffset = range.endOffset - 1 < 0 ? 0 : range.endOffset - 1;
|
||||
textRange.setStart(range.endContainer, startEndOffset);
|
||||
textRange.setEnd(range.endContainer, range.endOffset);
|
||||
const textRects = textRange.getClientRects();
|
||||
const tempRect = textRects.item(textRects.length - 1);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"id": "ninja-cursor",
|
||||
"name": "Ninja Cursor",
|
||||
"version": "0.0.9",
|
||||
"version": "0.0.10",
|
||||
"minAppVersion": "0.12.0",
|
||||
"description": "The plugin which enhance cursor visibility.",
|
||||
"author": "vorotamoroz",
|
||||
|
|
|
|||
4
package-lock.json
generated
4
package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "ninja-cursor",
|
||||
"version": "0.0.9",
|
||||
"version": "0.0.10",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "ninja-cursor",
|
||||
"version": "0.0.9",
|
||||
"version": "0.0.10",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@types/node": "^16.11.6",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "ninja-cursor",
|
||||
"version": "0.0.9",
|
||||
"version": "0.0.10",
|
||||
"description": "The plugin which enhance cursor visibility.",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
|
|
|
|||
Loading…
Reference in a new issue