Kandinsky: Get rid of KDCoordinateMax

Which is annoying to handle, because once you define it you have to
bother with additions overflowing...

Change-Id: I50b19858342c5a2909e3078f1a4167be50210db1
This commit is contained in:
Romain Goyet
2016-06-13 17:45:54 +02:00
parent 4c048a6832
commit e2a6cdff15
4 changed files with 12 additions and 9 deletions

View File

@@ -51,12 +51,7 @@ void ScrollView::layoutSubviews() {
m_verticalScrollIndicator.setFrame(verticalIndicatorFrame);
// Layout contentview
KDRect contentFrame;
contentFrame.origin = m_offset;
//contentFrame.size = m_contentView->bounds().size;
contentFrame.width = KDCoordinateMax;
contentFrame.height = KDCoordinateMax;
m_contentView->setFrame(contentFrame);
setContentViewOrigin();
}
void ScrollView::setContentOffset(KDPoint offset) {
@@ -72,6 +67,13 @@ void ScrollView::setContentOffset(KDPoint offset) {
markAsNeedingRedraw();
}
void ScrollView::setContentViewOrigin() {
KDRect contentFrame;
contentFrame.origin = m_offset;
contentFrame.size = m_contentView->bounds().size;
m_contentView->setFrame(contentFrame);
}
#if ESCHER_VIEW_LOGGING
const char * ScrollView::className() const {
return "ScrollView";