Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(278)

Side by Side Diff: src/views/animated/SkScrollBarView.cpp

Issue 12480002: Fixing some warnings on Linux (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "SkScrollBarView.h" 8 #include "SkScrollBarView.h"
9 #include "SkAnimator.h" 9 #include "SkAnimator.h"
10 #include "SkWidgetViews.h" 10 #include "SkWidgetViews.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 } 115 }
116 116
117 return this->INHERITED::onEvent(evt); 117 return this->INHERITED::onEvent(evt);
118 } 118 }
119 119
120 void SkScrollBarView::adjust() 120 void SkScrollBarView::adjust()
121 { 121 {
122 int total = fTotalLength; 122 int total = fTotalLength;
123 int start = fStartPoint; 123 int start = fStartPoint;
124 int shown = fShownLength; 124 int shown = fShownLength;
125 int hideBar = 0; 125 // int hideBar = 0;
sugoi 2013/03/06 16:14:59 The line using this variable is commented out.
126 126
127 if (total <= 0 || shown <= 0 || shown >= total) // no bar to show 127 if (total <= 0 || shown <= 0 || shown >= total) // no bar to show
128 { 128 {
129 total = 1; // avoid divide-by-zero. should be done by skin/script 129 total = 1; // avoid divide-by-zero. should be done by skin/script
130 hideBar = 1; // signal we don't want a thumb 130 // hideBar = 1; // signal we don't want a thumb
131 } 131 }
132 else 132 else
133 { 133 {
134 if (start + shown > total) 134 if (start + shown > total)
135 start = total - shown; 135 start = total - shown;
136 } 136 }
137 137
138 SkEvent e("user"); 138 SkEvent e("user");
139 e.setString("id", "adjustScrollBar"); 139 e.setString("id", "adjustScrollBar");
140 e.setScalar("_totalLength", SkIntToScalar(total)); 140 e.setScalar("_totalLength", SkIntToScalar(total));
141 e.setScalar("_startPoint", SkIntToScalar(start)); 141 e.setScalar("_startPoint", SkIntToScalar(start));
142 e.setScalar("_shownLength", SkIntToScalar(shown)); 142 e.setScalar("_shownLength", SkIntToScalar(shown));
143 // e.setS32("hideBar", hideBar); 143 // e.setS32("hideBar", hideBar);
144 fAnim.doUserEvent(e); 144 fAnim.doUserEvent(e);
145 } 145 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698