Skip to content

Commit 2fc8861

Browse files
committed
Remove console.log
1 parent 15ec453 commit 2fc8861

File tree

2 files changed

+0
-116
lines changed

2 files changed

+0
-116
lines changed

src/Canvas.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ export const Canvas: React.FC<Props> = ({
3535
useEffectOnce(() => {
3636
// create
3737
if (canvas.current instanceof HTMLCanvasElement) {
38-
//console.log("create");
3938
scope.current = new PaperScope();
4039
Object.assign(scope.current.settings, {
4140
...settings,
@@ -59,7 +58,6 @@ export const Canvas: React.FC<Props> = ({
5958

6059
// destroy
6160
return () => {
62-
//console.log("destroy");
6361
if (fiber.current) {
6462
Renderer.updateContainer(null, fiber.current, null, () => null);
6563
}
@@ -71,15 +69,13 @@ export const Canvas: React.FC<Props> = ({
7169

7270
// update
7371
useEffect(() => {
74-
//console.log("update", scope.current?._id);
7572
if (scope.current && fiber.current) {
7673
Renderer.updateContainer(children, fiber.current, null, () => null);
7774
}
7875
}, [children]);
7976

8077
// resize
8178
useEffect(() => {
82-
//console.log("resize");
8379
if (scope.current) {
8480
scope.current.view.viewSize = new scope.current.Size(width, height);
8581
}

src/Renderer.ts

Lines changed: 0 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,6 @@ const getSymbolDefinition = (scope: Container, { id, name, svg }: Props) => {
140140
return definition;
141141
};
142142

143-
// https://github.com/facebook/react/tree/master/packages/react-reconciler
144-
// https://github.com/facebook/react/blob/master/packages/react-art/src/ReactARTHostConfig.js
145-
146143
export const Renderer = Reconciler({
147144
createInstance: (type: Type, instanceProps: Props, scope: Container) => {
148145
const { children, ...other } = instanceProps;
@@ -207,17 +204,6 @@ export const Renderer = Reconciler({
207204
instance.props = other;
208205
instance.type = type;
209206

210-
/*
211-
console.log(
212-
"createInstance",
213-
scope.name,
214-
scope.project.name,
215-
instance.project?.name,
216-
instance.type,
217-
instance.id
218-
);
219-
*/
220-
221207
return instance;
222208
},
223209

@@ -254,147 +240,51 @@ export const Renderer = Reconciler({
254240
supportsPersistence: false,
255241

256242
appendInitialChild: (parent: Instance, child: Instance) => {
257-
console.log("appendInitialChild");
258243
if (parent instanceof paper.Group && child instanceof paper.Item) {
259244
child.addTo(parent);
260245
}
261246
if (parent instanceof paper.View && child instanceof paper.Item) {
262247
child.addTo(parent._project);
263248
}
264-
/*
265-
console.log(
266-
"appendInitialChild",
267-
parent.project?._scope.name,
268-
parent.project?.name,
269-
child.project?._scope.name,
270-
child.project?.name,
271-
child.type,
272-
child.id
273-
);
274-
console.log({
275-
child: {
276-
item: child instanceof paper.Item,
277-
group: child instanceof paper.Group,
278-
layer: child instanceof paper.Layer,
279-
tool: child instanceof paper.Tool,
280-
raster: child instanceof paper.Raster,
281-
child,
282-
},
283-
parent: {
284-
item: parent instanceof paper.Item,
285-
group: parent instanceof paper.Group,
286-
layer: parent instanceof paper.Layer,
287-
tool: parent instanceof paper.Tool,
288-
view: parent instanceof paper.View,
289-
parent,
290-
},
291-
});
292-
*/
293249
},
294250

295251
finalizeInitialChildren: (instance: Instance, type: Type, props: Props) => {
296-
console.log("finalizeInitialChildren");
297252
if (instance instanceof paper.Tool) {
298253
applyProps(instance, props);
299254
}
300255
return false;
301-
/*
302-
console.log(
303-
"finalizeInitialChildren",
304-
instance.project?._scope.name,
305-
instance.project?.name,
306-
instance.type,
307-
instance.id
308-
);
309-
/*
310-
switch (type) {
311-
case Item.View:
312-
case Item.Layer:
313-
case Item.Group:
314-
case Item.Tool:
315-
applyProps(instance, props);
316-
break;
317-
default:
318-
break;
319-
}
320-
return true;
321-
*/
322256
},
323257

324258
appendChild: (parent: Instance, child: Instance) => {
325-
console.log("appendChild");
326259
if (parent instanceof paper.Group && child instanceof paper.Item) {
327260
child.addTo(parent);
328261
}
329262
if (parent instanceof paper.View && child instanceof paper.Item) {
330263
child.addTo(parent._project);
331264
}
332-
/*
333-
console.log(
334-
"appendChild",
335-
parent.project?._scope.name,
336-
parent.project?.name,
337-
child.project?._scope.name,
338-
child.project?.name,
339-
child.type,
340-
child.id
341-
);
342-
console.log({
343-
child: {
344-
item: child instanceof paper.Item,
345-
group: child instanceof paper.Group,
346-
layer: child instanceof paper.Layer,
347-
tool: child instanceof paper.Tool,
348-
raster: child instanceof paper.Raster,
349-
child,
350-
},
351-
parent: {
352-
item: parent instanceof paper.Item,
353-
group: parent instanceof paper.Group,
354-
layer: parent instanceof paper.Layer,
355-
tool: parent instanceof paper.Tool,
356-
view: parent instanceof paper.View,
357-
parent,
358-
},
359-
});
360-
*/
361265
},
362266

363267
appendChildToContainer: (container: Container, child: Instance) => {
364-
console.log("appendChildToContainer");
365268
if (!(child instanceof paper.View || child instanceof paper.Tool)) {
366269
throw new Error("Container can only hold View and Tool nodes");
367270
}
368271
},
369272

370273
insertBefore: (parent: Instance, child: Instance, before: Instance) => {
371-
console.log("insertBefore");
372274
if (
373275
parent instanceof paper.Group &&
374276
child instanceof paper.Item &&
375277
before instanceof paper.Item
376278
) {
377279
child.insertAbove(before);
378280
}
379-
/*
380-
console.log(
381-
"insertBefore",
382-
parent.project?._scope.name,
383-
parent.project?.name,
384-
child.project?._scope.name,
385-
child.project?.name,
386-
child.type,
387-
child.id
388-
);
389-
*/
390281
},
391282

392283
insertInContainerBefore: (
393284
container: Container,
394285
child: Instance,
395286
before: Instance
396287
) => {
397-
console.log("insertInContainerBefore");
398288
if (
399289
!(child instanceof paper.View || child instanceof paper.Tool) ||
400290
!(before instanceof paper.View || before instanceof paper.Tool)
@@ -404,14 +294,12 @@ export const Renderer = Reconciler({
404294
},
405295

406296
removeChild: (parent: Instance, child: Instance) => {
407-
console.log("removeChild");
408297
if (typeof child.remove === "function") {
409298
child.remove();
410299
}
411300
},
412301

413302
removeChildFromContainer: (container: Container, child: Instance) => {
414-
console.log("removeChildFromContainer");
415303
if (typeof child.remove === "function") {
416304
child.remove();
417305
}

0 commit comments

Comments
 (0)