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.js
CHANGED
|
@@ -800,7 +800,7 @@ var HANDLE_BAR_WIDTH = 3;
|
|
|
800
800
|
var HANDLE_BAR_GAP = 1;
|
|
801
801
|
var HANDLE_BAR_HEIGHT = 10;
|
|
802
802
|
var roundedRect = (ctx, x, y, width, height, radius) => {
|
|
803
|
-
const r = Math.min(radius, width / 2, height / 2);
|
|
803
|
+
const r = Math.max(0, Math.min(radius, width / 2, height / 2));
|
|
804
804
|
ctx.beginPath();
|
|
805
805
|
if (typeof ctx.roundRect === "function") {
|
|
806
806
|
ctx.roundRect(x, y, width, height, r);
|
|
@@ -971,6 +971,7 @@ var drawEvents = (ctx, view, scene, font, animator) => {
|
|
|
971
971
|
const paintEvent = (event, rect, state, opts) => {
|
|
972
972
|
var _a2, _b, _c, _d, _e;
|
|
973
973
|
ctx.save();
|
|
974
|
+
ctx.globalAlpha = 1;
|
|
974
975
|
if (opts.elevate) {
|
|
975
976
|
ctx.translate(0, -view.theme.selectionElevation);
|
|
976
977
|
ctx.shadowColor = view.theme.selectionShadowColor;
|
|
@@ -2801,9 +2802,17 @@ var Timeline = (0, import_react7.forwardRef)(
|
|
|
2801
2802
|
(_a = rendererRef.current) == null ? void 0 : _a.animator.reset();
|
|
2802
2803
|
}, [scene, rows]);
|
|
2803
2804
|
(0, import_react7.useEffect)(() => {
|
|
2804
|
-
var _a;
|
|
2805
|
+
var _a, _b, _c;
|
|
2805
2806
|
scene.setEvents([...events].sort(sort_events_default));
|
|
2806
2807
|
(_a = rendererRef.current) == null ? void 0 : _a.animator.reset();
|
|
2808
|
+
const survivors = [...selectionRef.current].filter(
|
|
2809
|
+
(id) => scene.getEvent(id) !== void 0
|
|
2810
|
+
);
|
|
2811
|
+
if (survivors.length !== selectionRef.current.size) {
|
|
2812
|
+
selectionRef.current = new Set(survivors);
|
|
2813
|
+
(_b = rendererRef.current) == null ? void 0 : _b.setView({ selectedEventIds: selectionRef.current });
|
|
2814
|
+
(_c = onSelectionChangeRef.current) == null ? void 0 : _c.call(onSelectionChangeRef, survivors);
|
|
2815
|
+
}
|
|
2807
2816
|
}, [scene, events]);
|
|
2808
2817
|
(0, import_react7.useEffect)(() => {
|
|
2809
2818
|
scene.setStaticEvents(staticEvents ? [...staticEvents] : []);
|