Skip to content

add grid_sacle option#624

Open
huijiewei wants to merge 7 commits intoIonDen:masterfrom
huijiewei:master
Open

add grid_sacle option#624
huijiewei wants to merge 7 commits intoIonDen:masterfrom
huijiewei:master

Conversation

@huijiewei
Copy link
Copy Markdown

No description provided.

@IonDen
Copy link
Copy Markdown
Owner

IonDen commented Jul 26, 2019

Hi, description? Demo?

@huijiewei
Copy link
Copy Markdown
Author

huijiewei commented Jul 26, 2019

Hi, description? Demo?

Sorry for my english, grid_scale means custom label show. code is very simple:

            if (this.options.grid_scale.length > 0) {
                for (i = 0; i < num; i++) {
                    label = this.$cache.grid_labels[i][0];
                    var scale = $(label).html();

                     var inArray = false;

                     $.each(this.options.grid_scale, function () {
                        if (this == scale) {
                            inArray = true;
                            return false;
                        }
                    });

                     if (inArray) {
                        label.style.visibility = "visible";
                    } else {
                        label.style.visibility = "hidden";
                    }
                }
            } else {
                this.calcGridCollision(2, start, finish);
                this.calcGridCollision(4, start, finish);
            }

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

Successfully merging this pull request may close these issues.

2 participants