Skip to content

Commit

Permalink
Optimize the canvas transform strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
runinspring committed Oct 11, 2019
1 parent 1833c81 commit 6dfc04d
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 2,746 deletions.
12 changes: 12 additions & 0 deletions doc/release-note/0.2.9/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## Baidu MiniGame Support 0.2.9 Release Notes

- **[OPTIMIZE]** Optimize the canvas transform strategy
- **[OPTIMIZE]** Remove invalid comments and reduce the volume of the adapter layer js file


## 百度小游戏支持库 0.2.9 更新日志
- **[优化]** 优化 canvas 缩放策略
- **[优化]** 移除无效的注释,减小适配层 js 文件体积


【2019.10.15】
5 changes: 0 additions & 5 deletions src/WebPlayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,6 @@ namespace egret.baidugame {
let canvasScaleX = scalex * sys.DisplayList.$canvasScaleFactor;
let canvasScaleY = scaley * sys.DisplayList.$canvasScaleFactor;

let m = new egret.Matrix();
m.scale(scalex / canvasScaleX, scaley / canvasScaleY);
m.rotate(rotation * Math.PI / 180);
let transform = `matrix(${m.a},${m.b},${m.c},${m.d},${m.tx},${m.ty})`;
canvas.style[getPrefixStyleName("transform")] = transform;
sys.DisplayList.$setCanvasScale(canvasScaleX, canvasScaleY);
this.webTouchHandler.updateScaleMode(scalex, scaley, rotation);
this.player.updateStageSize(stageWidth, stageHeight);//不要在这个方法后面修改属性
Expand Down
2 changes: 1 addition & 1 deletion target/target.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"projectType": "baidugame",
"version": "0.2.8",
"version": "0.2.9",
"args": [
{
"name": "appid",
Expand Down
Loading

0 comments on commit 6dfc04d

Please sign in to comment.