Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32236466
D13069.1765222214.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D13069.1765222214.diff
View Options
diff --git a/native/tooltip/nux-tips-overlay.react.js b/native/tooltip/nux-tips-overlay.react.js
--- a/native/tooltip/nux-tips-overlay.react.js
+++ b/native/tooltip/nux-tips-overlay.react.js
@@ -193,44 +193,56 @@
[position],
);
- const tipContainerStyle = React.useMemo(() => {
- const { x, y, width, height } = initialCoordinates;
-
- const style: WritableAnimatedStyleObj = {};
- style.position = 'absolute';
- style.alignItems = 'center';
- style.opacity = tipContainerOpacity;
-
- const transform: Array<ReanimatedTransform> = [];
+ const baseTipContainerStyle = React.useMemo(() => {
+ const { y, x, height, width } = initialCoordinates;
- transform.push({ translateX: tipHorizontal });
+ const top =
+ Math.min(y + height, verticalBounds.y + verticalBounds.height) + margin;
const extraLeftSpace = x;
const extraRightSpace = dimensions.width - width - x;
if (extraLeftSpace < extraRightSpace) {
- style.left = 0;
- style.minWidth = width + 2 * extraLeftSpace;
+ return {
+ top,
+ position: 'absolute',
+ alignItems: 'center',
+ left: 0,
+ minWidth: width + 2 * extraLeftSpace,
+ };
} else {
- style.right = 0;
- style.minWidth = width + 2 * extraRightSpace;
+ return {
+ top,
+ position: 'absolute',
+ alignItems: 'center',
+ right: 0,
+ minWidth: width + 2 * extraRightSpace,
+ };
}
+ }, [
+ dimensions.width,
+ initialCoordinates,
+ verticalBounds.height,
+ verticalBounds.y,
+ ]);
- style.top =
- Math.min(y + height, verticalBounds.y + verticalBounds.height) + margin;
+ const tipContainerStyle = React.useMemo(() => {
+ const style: WritableAnimatedStyleObj = {};
+ style.opacity = tipContainerOpacity;
+
+ const transform: Array<ReanimatedTransform> = [];
+
+ transform.push({ translateX: tipHorizontal });
transform.push({ translateY: tipVerticalBelow });
transform.push({ scale: tipScale });
style.transform = transform;
- return style;
+ return { ...baseTipContainerStyle, ...style };
}, [
- dimensions.width,
- initialCoordinates,
+ baseTipContainerStyle,
tipContainerOpacity,
tipHorizontal,
tipScale,
tipVerticalBelow,
- verticalBounds.height,
- verticalBounds.y,
]);
const triangleStyle = React.useMemo(() => {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Dec 8, 7:30 PM (10 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5850171
Default Alt Text
D13069.1765222214.diff (2 KB)
Attached To
Mode
D13069: [native] Extract normal style from animated style
Attached
Detach File
Event Timeline
Log In to Comment