<commit_before>import PIXIHelper from '../class/pixi/helper/PIXIHelper';
import { PIXIGlobal } from '../class/pixi/init/PIXIGlobal';
import { GEDragHelper } from './GEDragHelper';
import { IGEResManager } from './IGEResManager';
import { EaselResManager } from './EaselResManager';
import { PIXISprite } from '../class/pixi/plugins/PIXISprite';
import { PIXIBrushAdaptor } from '../class/pixi/etc/PIXIBrushAdaptor';
import { PIXIScaleAdaptor } from '../class/pixi/atlas/PIXIScaleAdaptor';




declare let createjs:any;

interface IGraphicsEngineApplication {
    render():void;
    stage:PIXI.Container|any;
    destroy(destroyOption:any):void;
}

interface ITicker {
    reset():void;
    setFPS(n:number):void;
}

class CreateJsApplication implements IGraphicsEngineApplication {

    stage:any;

    constructor(canvas:HTMLCanvasElement) {
        let stage = new createjs.Stage(canvas.id);
        createjs.Touch.enable(stage);
        stage.enableMouseOver(10);
        stage.mouseMoveOutside = true;
        this.stage = stage;
    }
    render():void {
        this.stage.update();
    }
    destroy(destroyOption:any) {
        this.stage = null;
    }
}


export class GEHelperBase {

    protected _isWebGL:boolean = false;
    INIT(isWebGL:boolean) {
        this._isWebGL = isWebGL;
    }
}

const emptyFn = (...arg:any[])=>{};

class _GEHelper extends GEHelperBase {


    get isWebGL():boolean { return this._isWebGL; }
    public resManager:IGEResManager;
    public textHelper:_TextHelper;
    public colorFilter:_ColorFilterHelper;
    public brushHelper:_BrushHelper;

    /**  pixi 객체로부터 rotate를 읽을 때 사용할 값 */
    public rotateRead:number = 1;

    /**  pixi 객체에 rotate를 할당 할 때 사용할 값 */
    public rotateWrite:number = 1;

    public Ticker:ITicker;
    private _isInitialized:boolean;


    /**
     * issues/9422#issuecomment-2678582
     * 최종 좌표 결정 단계에서 약간의 오차를 주어 이 현상을 막음.
     */
    public rndPosition:()=>number;

    INIT(isWebGL:boolean) {
        super.INIT(isWebGL);
        if(this._isInitialized) return;
        this._isInitialized = true;
        GEDragHelper.INIT(isWebGL);
        (this.colorFilter = new _ColorFilterHelper()).INIT(isWebGL);
        (this.textHelper = new _TextHelper()).INIT(isWebGL);
        (this.brushHelper = new _BrushHelper()).INIT(isWebGL);
        if(this._isWebGL) {
            this.rndPosition = ()=>{ return Math.random() * 0.04 - 0.02;};
            this.rotateRead = 180 / Math.PI;
            this.rotateWrite = Math.PI / 180;
            PIXIGlobal.initOnce();
            this.resManager = PIXIGlobal.atlasManager;
            this.Ticker = {
                reset: emptyFn,
                setFPS:emptyFn
            };
        } else {<commit_msg>[WebGL] #9422 대각선 스크래치 이슈 해결하려 했으나 실패하여 원복함.<commit_after>import PIXIHelper from '../class/pixi/helper/PIXIHelper';
import { PIXIGlobal } from '../class/pixi/init/PIXIGlobal';
import { GEDragHelper } from './GEDragHelper';
import { IGEResManager } from './IGEResManager';
import { EaselResManager } from './EaselResManager';
import { PIXISprite } from '../class/pixi/plugins/PIXISprite';
import { PIXIBrushAdaptor } from '../class/pixi/etc/PIXIBrushAdaptor';
import { PIXIScaleAdaptor } from '../class/pixi/atlas/PIXIScaleAdaptor';




declare let createjs:any;

interface IGraphicsEngineApplication {
    render():void;
    stage:PIXI.Container|any;
    destroy(destroyOption:any):void;
}

interface ITicker {
    reset():void;
    setFPS(n:number):void;
}

class CreateJsApplication implements IGraphicsEngineApplication {

    stage:any;

    constructor(canvas:HTMLCanvasElement) {
        let stage = new createjs.Stage(canvas.id);
        createjs.Touch.enable(stage);
        stage.enableMouseOver(10);
        stage.mouseMoveOutside = true;
        this.stage = stage;
    }
    render():void {
        this.stage.update();
    }
    destroy(destroyOption:any) {
        this.stage = null;
    }
}


export class GEHelperBase {

    protected _isWebGL:boolean = false;
    INIT(isWebGL:boolean) {
        this._isWebGL = isWebGL;
    }
}

const emptyFn = (...arg:any[])=>{};

class _GEHelper extends GEHelperBase {


    get isWebGL():boolean { return this._isWebGL; }
    public resManager:IGEResManager;
    public textHelper:_TextHelper;
    public colorFilter:_ColorFilterHelper;
    public brushHelper:_BrushHelper;

    /**  pixi 객체로부터 rotate를 읽을 때 사용할 값 */
    public rotateRead:number = 1;

    /**  pixi 객체에 rotate를 할당 할 때 사용할 값 */
    public rotateWrite:number = 1;

    public Ticker:ITicker;
    private _isInitialized:boolean;


    /**
     * issues/9422#issuecomment-2678582
     * 최종 좌표 결정 단계에서 약간의 오차를 주어 이 현상을 막음.
     */
    public rndPosition:()=>number;

    INIT(isWebGL:boolean) {
        super.INIT(isWebGL);
        if(this._isInitialized) return;
        this._isInitialized = true;
        GEDragHelper.INIT(isWebGL);
        (this.colorFilter = new _ColorFilterHelper()).INIT(isWebGL);
        (this.textHelper = new _TextHelper()).INIT(isWebGL);
        (this.brushHelper = new _BrushHelper()).INIT(isWebGL);
        if(this._isWebGL) {
            // this.rndPosition = ()=>{ return Math.random() * 0.8 - 0.4; };
            this.rndPosition = ()=>{ return 0; };
            this.rotateRead = 180 / Math.PI;
            this.rotateWrite = Math.PI / 180;
            PIXIGlobal.initOnce();
            this.resManager = PIXIGlobal.atlasManager;
            this.Ticker = {
                reset: emptyFn,
                setFPS:emptyFn
            };
        } else {
{'fraction_non_alphanumeric': 0.12271493212669683, 'fraction_numerical': 0.010316742081447963, 'mean_word_length': 2.7012726054922975, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4713419', 'n_tokens_mistral': 1966, 'n_tokens_neox': 1950, 'n_words': 345}