This commit is contained in:
侯歌 2021-10-12 13:40:53 +08:00
commit f57269a456
2 changed files with 4 additions and 5 deletions

View File

@ -120,14 +120,12 @@ void ScrollBarDrawable::drawThumb(Canvas& canvas,const Rect& bounds, int offset,
if (vertical) {
if (mVerticalThumb != nullptr) {
if (changed)
mVerticalThumb->setBounds(bounds.left, bounds.top + offset,bounds.width, offset + length);
mVerticalThumb->setBounds(bounds.left, bounds.top + offset,bounds.width, length);
mVerticalThumb->draw(canvas);
}
} else if ( mHorizontalThumb ) {
if (changed)
mHorizontalThumb->setBounds(bounds.left+ offset, bounds.top,offset + length, bounds.height);
mHorizontalThumb->setBounds(bounds.left+ offset, bounds.top,length, bounds.height);:wq
mHorizontalThumb->draw(canvas);
}
}

View File

@ -178,7 +178,8 @@ TEST_F(WIDGET,Keyboard){
Window*w=new Window(100,100,800,400);
KeyboardView*kbv=new KeyboardView(800,300);
kbv->setBackgroundColor(0xFFEEEEEE);
kbv->setKeyboard(Keyboard::loadFrom("qwerty.json"));
Keyboard*kbd = new Keyboard(&app,"cdroid:xml/qwerty.xml",800,200);
kbv->setKeyboard(kbd);
w->addView(kbv).setPos(20,10);
app.exec();
}