mirror of
https://github.com/Doodle3D/Doodle3D-Core.git
synced 2024-11-04 21:53:24 +01:00
initial pattern render
This commit is contained in:
parent
5e27d0429d
commit
bc9b6c356e
@ -20,6 +20,7 @@ import { PIXEL_RATIO } from '../constants/general';
|
||||
import ShapesManager from '../d2/ShapesManager.js';
|
||||
import EventGroup from '../d2/EventGroup.js';
|
||||
import ReactResizeDetector from 'react-resize-detector';
|
||||
import { load as loadPattern } from '../d2/Shape.js';
|
||||
// import createDebug from 'debug';
|
||||
// const debug = createDebug('d3d:d2');
|
||||
|
||||
@ -91,6 +92,11 @@ class D2Panel extends React.Component {
|
||||
this.objectContainerInactive.add(new Grid(new CAL.Color(0xdddddd)));
|
||||
|
||||
this.shapesManager = new ShapesManager(this.objectContainerActive, this.objectContainerInactive);
|
||||
loadPattern.then(() => {
|
||||
this.activeNeedRender = true;
|
||||
this.inactiveNeedRender = true;
|
||||
this.renderRequest();
|
||||
});
|
||||
|
||||
this.DOM = null;
|
||||
}
|
||||
|
@ -9,8 +9,8 @@ import holePaternUrl from '../../img/holepatern.png';
|
||||
import { loadImage } from '../utils/imageUtils.js';
|
||||
|
||||
let holePatern;
|
||||
loadImage(holePaternUrl).then(image => {
|
||||
holePatern = document.createElement('canvas').getContext('2d').createPattern(image, 'repeat')
|
||||
export const load = loadImage(holePaternUrl).then(image => {
|
||||
holePatern = document.createElement('canvas').getContext('2d').createPattern(image, 'repeat');
|
||||
});
|
||||
|
||||
export default class Shape extends Matrix {
|
||||
|
Loading…
Reference in New Issue
Block a user