awesome-timeline-react 0.4.2 → 0.4.3
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/dist/index.js +11 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -788,7 +788,7 @@ var HANDLE_BAR_WIDTH = 3;
|
|
|
788
788
|
var HANDLE_BAR_GAP = 1;
|
|
789
789
|
var HANDLE_BAR_HEIGHT = 10;
|
|
790
790
|
var roundedRect = (ctx, x, y, width, height, radius) => {
|
|
791
|
-
const r = Math.min(radius, width / 2, height / 2);
|
|
791
|
+
const r = Math.max(0, Math.min(radius, width / 2, height / 2));
|
|
792
792
|
ctx.beginPath();
|
|
793
793
|
if (typeof ctx.roundRect === "function") {
|
|
794
794
|
ctx.roundRect(x, y, width, height, r);
|
|
@@ -959,6 +959,7 @@ var drawEvents = (ctx, view, scene, font, animator) => {
|
|
|
959
959
|
const paintEvent = (event, rect, state, opts) => {
|
|
960
960
|
var _a2, _b, _c, _d, _e;
|
|
961
961
|
ctx.save();
|
|
962
|
+
ctx.globalAlpha = 1;
|
|
962
963
|
if (opts.elevate) {
|
|
963
964
|
ctx.translate(0, -view.theme.selectionElevation);
|
|
964
965
|
ctx.shadowColor = view.theme.selectionShadowColor;
|
|
@@ -2789,9 +2790,17 @@ var Timeline = forwardRef3(
|
|
|
2789
2790
|
(_a = rendererRef.current) == null ? void 0 : _a.animator.reset();
|
|
2790
2791
|
}, [scene, rows]);
|
|
2791
2792
|
useEffect6(() => {
|
|
2792
|
-
var _a;
|
|
2793
|
+
var _a, _b, _c;
|
|
2793
2794
|
scene.setEvents([...events].sort(sort_events_default));
|
|
2794
2795
|
(_a = rendererRef.current) == null ? void 0 : _a.animator.reset();
|
|
2796
|
+
const survivors = [...selectionRef.current].filter(
|
|
2797
|
+
(id) => scene.getEvent(id) !== void 0
|
|
2798
|
+
);
|
|
2799
|
+
if (survivors.length !== selectionRef.current.size) {
|
|
2800
|
+
selectionRef.current = new Set(survivors);
|
|
2801
|
+
(_b = rendererRef.current) == null ? void 0 : _b.setView({ selectedEventIds: selectionRef.current });
|
|
2802
|
+
(_c = onSelectionChangeRef.current) == null ? void 0 : _c.call(onSelectionChangeRef, survivors);
|
|
2803
|
+
}
|
|
2795
2804
|
}, [scene, events]);
|
|
2796
2805
|
useEffect6(() => {
|
|
2797
2806
|
scene.setStaticEvents(staticEvents ? [...staticEvents] : []);
|