gpt4 book ai didi

Android:DrawRect 未在高清手机的 Canvas 上显示

转载 作者:搜寻专家 更新时间:2023-11-01 08:01:33 25 4
gpt4 key购买 nike

最近我开发了棋盘游戏 ( https://play.google.com/store/apps/details?id=com.pradhan.manoj.CoinStack )。它在所有 Android 设备上运行良好,除了少数具有高清显示屏的手机,包括 Micromax Canvas HD 和 Samsung Galaxy Grand。我一直很难弄清楚自己做错了什么。以下是代码的摘录...

  rectPaint = new Paint();
rectPaint.setAntiAlias(true);
rectPaint.setDither(true);
rectPaint.setColor(Color.BLACK);
rectPaint.setStyle(Paint.Style.STROKE);
rectPaint.setStrokeJoin(Paint.Join.ROUND);
rectPaint.setStrokeCap(Paint.Cap.ROUND);

//CurrentX, CurrentY are calculated dynamically

rectPaint.setStyle(Paint.Style.FILL);
canvas.drawRect(currentX,currentY,currentX+cellWidth,currentY-cellHeight,rectPaint);
rectPaint.setStyle(Paint.Style.STROKE);
rectPaint.setColor(Color.BLUE);
canvas.drawRect(currentX,currentY,currentX+cellWidth,currentY-cellHeight,rectPaint);

非常感谢您提出专家意见/建议来解决这个问题。

最佳答案

可能的解决方案:检查坐标的差异 - 它不应该是负数。

关于Android:DrawRect 未在高清手机的 Canvas 上显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20684291/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com