0.7.7-alpha: Merge branch 'main' into release
This commit is contained in:
commit
3f0fcbb626
|
|
@ -1,3 +1,8 @@
|
|||
# 0.7.7-alpha:
|
||||
Bugfixes:
|
||||
- Fix pasting multiple times
|
||||
- Hack around broken files
|
||||
|
||||
# 0.7.6-alpha:
|
||||
Bugfixes:
|
||||
- Fix errors when images are not present in a saved file
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"$schema": "https://schema.tauri.app/config/2",
|
||||
"productName": "Lightningbeam",
|
||||
"version": "0.7.6-alpha",
|
||||
"version": "0.7.7-alpha",
|
||||
"identifier": "org.lightningbeam.core",
|
||||
"build": {
|
||||
"frontendDist": "../src"
|
||||
|
|
|
|||
34
src/main.js
34
src/main.js
|
|
@ -705,8 +705,32 @@ let actions = {
|
|||
duplicateObject: {
|
||||
create: (items) => {
|
||||
redoStack.length = 0;
|
||||
function deepCopyWithIdxMapping(obj, dictionary = {}) {
|
||||
if (Array.isArray(obj)) {
|
||||
return obj.map(item => deepCopyWithIdxMapping(item, dictionary));
|
||||
}
|
||||
if (obj === null || typeof obj !== 'object') {
|
||||
return obj;
|
||||
}
|
||||
|
||||
const newObj = {};
|
||||
for (const key in obj) {
|
||||
let value = obj[key];
|
||||
|
||||
if (key === 'idx' && !(value in dictionary)) {
|
||||
dictionary[value] = uuidv4();
|
||||
}
|
||||
|
||||
newObj[key] = value in dictionary ? dictionary[value] : value;
|
||||
if (typeof newObj[key] === 'object' && newObj[key] !== null) {
|
||||
newObj[key] = deepCopyWithIdxMapping(newObj[key], dictionary);
|
||||
}
|
||||
}
|
||||
|
||||
return newObj;
|
||||
}
|
||||
let action = {
|
||||
items: items,
|
||||
items: deepCopyWithIdxMapping(items),
|
||||
object: context.activeObject.idx,
|
||||
frame: context.activeObject.currentFrame.idx,
|
||||
uuid: uuidv4(),
|
||||
|
|
@ -2940,7 +2964,7 @@ class BaseShape {
|
|||
// }
|
||||
if (this.filled) {
|
||||
ctx.beginPath();
|
||||
if (this.fillImage) {
|
||||
if (this.fillImage && this.fillImage instanceof Element) {
|
||||
let pat;
|
||||
if (this.fillImage instanceof Element ||
|
||||
Object.keys(this.fillImage).length !== 0) {
|
||||
|
|
@ -3315,7 +3339,11 @@ class Shape extends BaseShape {
|
|||
// }
|
||||
newShape.updateVertices();
|
||||
newShape.fillStyle = this.fillStyle;
|
||||
newShape.fillImage = this.fillImage;
|
||||
if (this.fillImage instanceof Element) {
|
||||
newShape.fillImage = this.fillImage.cloneNode(true)
|
||||
} else {
|
||||
newShape.fillImage = this.fillImage;
|
||||
}
|
||||
newShape.strokeStyle = this.strokeStyle;
|
||||
newShape.lineWidth = this.lineWidth;
|
||||
newShape.filled = this.filled;
|
||||
|
|
|
|||
Loading…
Reference in New Issue