Open
Conversation
ZWboy97
requested changes
Jan 24, 2021
| ] | ||
| ], | ||
| "hot_spot_list": [ | ||
| [ |
Owner
There was a problem hiding this comment.
改变了数据结构时候,之前的部分正常嘛?之前这么设计的原因是便于将这个列表直接映射转化未一个Map
public/mock/view1.json
Outdated
| "img_height": 100, | ||
| "img_width": 150 | ||
| }, | ||
| "event": { |
src/display/SpriteShapeHelper.js
Outdated
| this.resetHotSpotGroup(); | ||
| this.hotSpotMap = new Map(hot_spot_list); | ||
| this.hotSpotMap = new Map(); | ||
| this.eventMap = new Map(); |
Owner
There was a problem hiding this comment.
需要将event单独用一个Map进行映射吗?优势是什么??? 将event直接放在hotSpotMap中可以吗?它们都有相同的key,且本来它们就是在一块的
Contributor
Author
There was a problem hiding this comment.
event单独出来主要是为了和之前的代码兼容,如果合在一起就可能需要更改一些已有的接口,比如添加热点以前是传两个参数:热点属性、事件,现在只需要传热点属性,而需要调用接口的一方提前把事件写在热点属性里面,这样需要修改调用方的代码。当然也可以接口参数不变,在接口内部的时候把事件放在热点属性里面,但是这样会修改用户传进来的热点属性、有可能导致一些奇怪的bug;或者把用户传进来的热点属性复制一份,这样会增加运算量。目前在写把event放在hotSpotMap中的版本,暂时采取不改变对外接口的方法。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
抽取导览接口;利用事件中心初步更改之前的标签事件、导览事件