rename isVisibleElement
-> isElementInViewport
This commit is contained in:
parent
dbaa13ab97
commit
23ef690222
@ -189,7 +189,7 @@ import {
|
||||
isArrowKey,
|
||||
KEYS,
|
||||
} from "../keys";
|
||||
import { isVisibleElement } from "../element/sizeHelpers";
|
||||
import { isElementInViewport } from "../element/sizeHelpers";
|
||||
import {
|
||||
distance2d,
|
||||
getCornerRadius,
|
||||
@ -800,7 +800,7 @@ class App extends React.Component<AppProps, AppState> {
|
||||
this.state,
|
||||
);
|
||||
const embedLink = getEmbedLink(toValidURL(el.link || ""));
|
||||
const isVisible = isVisibleElement(
|
||||
const isVisible = isElementInViewport(
|
||||
el,
|
||||
normalizedWidth,
|
||||
normalizedHeight,
|
||||
@ -963,7 +963,7 @@ class App extends React.Component<AppProps, AppState> {
|
||||
return this.scene.getNonDeletedFrames().map((f, index) => {
|
||||
if (
|
||||
!this.canvas ||
|
||||
!isVisibleElement(
|
||||
!isElementInViewport(
|
||||
f,
|
||||
this.canvas.width / window.devicePixelRatio,
|
||||
this.canvas.height / window.devicePixelRatio,
|
||||
|
@ -15,7 +15,7 @@ export const isInvisiblySmallElement = (
|
||||
return element.width === 0 && element.height === 0;
|
||||
};
|
||||
|
||||
export const isVisibleElement = (
|
||||
export const isElementInViewport = (
|
||||
element: ExcalidrawElement,
|
||||
width: number,
|
||||
height: number,
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { isVisibleElement } from "../element/sizeHelpers";
|
||||
import { isElementInViewport } from "../element/sizeHelpers";
|
||||
import { isImageElement } from "../element/typeChecks";
|
||||
import { NonDeletedExcalidrawElement } from "../element/types";
|
||||
import { AppState } from "../types";
|
||||
@ -33,7 +33,7 @@ export class Renderer {
|
||||
width: AppState["width"];
|
||||
}): readonly NonDeletedExcalidrawElement[] => {
|
||||
return elements.filter((element) =>
|
||||
isVisibleElement(element, width, height, {
|
||||
isElementInViewport(element, width, height, {
|
||||
zoom,
|
||||
offsetLeft,
|
||||
offsetTop,
|
||||
|
Loading…
x
Reference in New Issue
Block a user