Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

features request #3

Open
neekey opened this issue Dec 16, 2014 · 0 comments
Open

features request #3

neekey opened this issue Dec 16, 2014 · 0 comments

Comments

@neekey
Copy link

neekey commented Dec 16, 2014

Hi, Thank you for creating such a helpful plugin for AI, which makes drawing complex vector graph in canvas possible.

As using this current version 1.3 in my project ( a map of China with provinces, landmarks, textures, clouds, waters, ships.. and so on, the total size of export is almost 6M ), I found the ability to only export root level layers is not efficient both in code development and AI design.

And, the more complicated the AI layers are, the more details need to be taken care of when considering the performance with canvas especially with mobile devices, all the layers should be drew only if necessary.

So below is the features I want to request:

Include boundary info

Boundary info is very helpful, which can be use to calculate if current layer is in the viewport or for other intentions.

I think every layer should include boundary info like below:

{
    left: 10,
    top: 10,
    width: 10,
    height: 20
}

Exports pure javascript data

It will be convenient if pure Javascript can be exported, and wrapped with CMD module, or just write to the global:

- map();

exports:

window.ai2canvas.map = {
    boundary: {
        left: 10,
        top: 10,
        width: 10,
        height: 20    
    },
    draw: function( ctx ){ ..... }
}

Support sublayers export

layers like:

- map
    - beijing
    - shanghai
    - ....

and exports:

window.ai2canvas.map = {
    name: 'map'
    boundary: {
        left: 10,
        top: 10,
        width: 10,
        height: 20    
    },
    draw: function( ctx ){ ..... },
    children: [
        {
            name: 'beigjing',
            draw: function( ctx ){ ... },
            ....
        }
    ] // every child just like its father, have properties like `boundary`, `draw` and `children` if sublayers exist
}

Thank you~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant