From 1d6f1d4bf4a7dc68879b4c53bb1f6cf495f0accf Mon Sep 17 00:00:00 2001 From: "mingzong.lzw" Date: Fri, 22 Nov 2019 13:06:16 +0800 Subject: [PATCH] 1.change ratio to original in gcanvas src 2.add depoly condition only on master --- .travis.yml | 2 +- GCanvas/core/src/gcanvas/GFontStyle.cpp | 2 +- GCanvas/core/src/gcanvas/GWebglContext.cpp | 36 +++++++++++----------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.travis.yml b/.travis.yml index 973b03a..5521d43 100644 --- a/.travis.yml +++ b/.travis.yml @@ -47,5 +47,5 @@ deploy: skip_cleanup: true on: repo: luckzhiwei/GCanvas - all_branches: true + branch: master tags: false \ No newline at end of file diff --git a/GCanvas/core/src/gcanvas/GFontStyle.cpp b/GCanvas/core/src/gcanvas/GFontStyle.cpp index c659e51..8f70119 100644 --- a/GCanvas/core/src/gcanvas/GFontStyle.cpp +++ b/GCanvas/core/src/gcanvas/GFontStyle.cpp @@ -27,7 +27,7 @@ namespace gcanvas { mStyle = Style::NORMAL; mVariant = Variant::NORMAL; mWeight = Weight::NORMAL; - mSize = 12 * 1; + mSize = 12 * ratio; mRatio = ratio; mFamily = "sans-serif"; mAscender = -1; diff --git a/GCanvas/core/src/gcanvas/GWebglContext.cpp b/GCanvas/core/src/gcanvas/GWebglContext.cpp index 19379d1..08b64ab 100644 --- a/GCanvas/core/src/gcanvas/GWebglContext.cpp +++ b/GCanvas/core/src/gcanvas/GWebglContext.cpp @@ -2168,10 +2168,10 @@ namespace gcanvas { int readPixels(GCanvasWeex *obj, const char *&p) { const int *tokens = ParseTokensInt(p, 6); float ratio = obj->GetDevicePixelRatio(); - GLint x = tokens[0] * 1; - GLint y = tokens[1] * 1; - GLsizei width = tokens[2] * 1; - GLsizei height = tokens[3] * 1; + GLint x = tokens[0] * ratio; + GLint y = tokens[1] * ratio; + GLsizei width = tokens[2] * ratio; + GLsizei height = tokens[3] * ratio; GLenum format = tokens[4]; GLenum type = tokens[5]; @@ -2201,8 +2201,8 @@ namespace gcanvas { GLenum target = tokens[0]; GLenum internalformat = tokens[1]; float ratio = obj->GetDevicePixelRatio(); - GLsizei width = tokens[2] * 1; - GLsizei height = tokens[3] * 1; + GLsizei width = tokens[2] * ratio; + GLsizei height = tokens[3] * ratio; LOG_D("[webgl::exec] glRenderbufferStorage(%s, %s, %d, %d)", GetMacroValDebug(target), GetMacroValDebug(internalformat), width, height); @@ -2227,10 +2227,10 @@ namespace gcanvas { int scissor(GCanvasWeex *obj, const char *&p) { const int *tokens = ParseTokensInt(p, 4); float ratio = obj->GetDevicePixelRatio(); - GLint x = tokens[0] * 1; - GLint y = tokens[1] * 1; - GLsizei width = tokens[2] * 1; - GLsizei height = tokens[3] * 1; + GLint x = tokens[0] * ratio; + GLint y = tokens[1] * ratio; + GLsizei width = tokens[2] * ratio; + GLsizei height = tokens[3] * ratio; LOG_D("[webgl::exec] glScissor(%d, %d, %d, %d)", x, y, width, height); glScissor(x, y, width, height); @@ -2900,14 +2900,14 @@ namespace gcanvas { const float *tokens = ParseTokensFloat(p, 4); float ratio = obj->GetDevicePixelRatio(); LOG_D("[webgl::exec] glViewport(%f, %f, %f, %f)", - tokens[0] * 1, - tokens[1] * 1, - tokens[2] * 1, - tokens[3] * 1); - glViewport(tokens[0] * 1, - tokens[1] * 1, - tokens[2] * 1, - tokens[3] * 1); + tokens[0] * ratio, + tokens[1] * ratio, + tokens[2] * ratio, + tokens[3] * ratio); + glViewport(tokens[0] * ratio, + tokens[1] * ratio, + tokens[2] * ratio, + tokens[3] * ratio); return kContinue; }