跟从你的快乐吧,宇宙会从四面都是墙的密室中为你打开一扇门。
首页 arrow 会员博客 arrow About Graphics.setClip()

About Graphics.setClip() 输出PDF 打印 E-mail
Author Author: jacky | Date Date: 2008-02-20 | View Count View: 1629 | section & Category 会员博客 -  个人博客

when I use g.setClip(x, y, w, h) in the componet AbstractWidget's paintContent method to limited child component's area, a strange thing occured: child component's style(border, background, padding, margin) just display a part, but child component could display completely, the codes similiar like below:

                g.setClip(getX(), getY(), w, h);  //limit display area
renderStyle(g); //paint child component's style
paintImpl(g); //paint child component

but at fellow's computer it could display right, very strange, after my test I modified codes like below:

               g.setClip(getX(), getY(), w + getX(), h + getY());
...

it runs right! but at fellow's computer it runs not right. I'm puzzled, maybe it's the version of WTK's fault, then I install the latest WTK2.5.2, the problem solved. So

               g.setClip(getX(), getY(), w + getX(), h + getY()); //fixed for WTK2.5.1
...

maybe the fault of WTK2.5.1

 



收藏到您的网摘: Google书签 Yahoo书签 雅虎收藏夹 365Key网摘 新浪ViVi 百度收藏 天极网摘 diglog 和讯网摘 POCO网摘 YouNote网摘 博拉网 天下图摘 spurl blogmarks BlinkList reddit digg Del.icio.us

本文关键字本文关键字: Graphics.setClip  

阅读数: 1630 | 打印 | E-mail

  评论 (2)
RSS评论
 1 Agreement
评论者 softear, 时间 2008-02-20 15:45
I think so. That looks apparently a bug of wireless toolkit 2.5.1. It did not call the native implementation.
 2 Agreement
评论者 javadeveloper, 时间 2008-02-21 10:26
But which version of WTK used at current cellphone or it's just a bug for simulator?

发表评论

姓名:
E-mail
您的网站/主页
标题:
评论:

验证码:* Code
若有人评论本文,请E-mail通知我。

(模拟器实现触摸屏) < 上一篇   下一篇 > (Start my journey)