[haiku-development] BScrollBar::SetRange() issue

  • From: "Stefano Ceccherini" <stefano.ceccherini@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Tue, 5 Jun 2007 16:57:35 +0200

While investigating bug #1241, I found out that our
BScrollBar::SetRange() doesn't update the scrollbar's value correctly
(due to a problem in BScrollBar::SetValue() like it should (BeBook
says:

"If the scroll bar's current value falls outside the new range, it
will be reset to the closest value—either min or max—within range"

I wrote a patch to fix that (included), but now Tracker misbehaves.
When resizing a scrollable view, the view itself is completely messed
up.

I was wondering if it's Tracker's fault or still BScrollbar's fault.
I.E. Has tracker been tested on R5 after r18481, for example ?
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
<html xmlns="http://www.w3.org/1999/xhtml"; lang="en" xml:lang="en">
<head>
 <title>#1241: scrollbar.diff - Haiku - Trac</title><link rel="start" 
href="/wiki" /><link rel="search" href="/search" /><link rel="help" 
href="/wiki/TracGuide" /><link rel="stylesheet" 
href="/trac-htdocs/css/trac.css" type="text/css" /><link rel="stylesheet" 
href="/trac-htdocs/css/diff.css" type="text/css" /><link rel="stylesheet" 
href="/trac-htdocs/css/code.css" type="text/css" /><link rel="icon" 
href="/trac-htdocs-local/favicon.ico" type="image/x-icon" /><link rel="shortcut 
icon" href="/trac-htdocs-local/favicon.ico" type="image/x-icon" /><link 
rel="up" href="/ticket/1241" title="Ticket #1241" /><link rel="alternate" 
href="/attachment/ticket/1241/scrollbar.diff?format=raw" title="Original 
Format" type="text/x-diff; charset=utf-8" /><style type="text/css">
#properties select.haikucomponent { width: 10em; float: left; clear: left; }
/*
 * <john> I found that Trac didn't really have enough id/classification to be
 * able to do this in a clean manor.
 * affects all fields in Ticket properties, but I can't see any harm in it.
 */
#properties table td { vertical-align: top; }

</style>
 <script type="text/javascript" src="/trac-htdocs/js/trac.js"></script>
</head>
<body>

<script type="text/javascript" 
src="/trac-htdocs-local/js/componentselect.js"></script>

<div id="banner">

<div id="header"><a id="logo" href="http://haiku-os.org";><img 
src="/trac-htdocs-local/logo.png" alt="Haiku" /></a><hr /></div>

<form id="search" action="/search" method="get">
 <div>
  <label for="proj-search">Search:</label>
  <input type="text" id="proj-search" name="q" size="10" accesskey="f" value="" 
/>
  <input type="submit" value="Search" />
  <input type="hidden" name="wiki" value="on" />
  <input type="hidden" name="changeset" value="on" />
  <input type="hidden" name="ticket" value="on" />
 </div>
</form>



<div id="metanav" class="nav"><ul><li class="first">logged in as 
<b>jackburton</b></li><li><b><a href="/logout">Logout</a></b></li><li><a 
accesskey="6" href="/wiki/TracGuide">Help/Guide</a></li><li class="last"><a 
href="/about">About Trac</a></li></ul></div>
</div>

<div id="mainnav" class="nav"><ul><li class="first"><a accesskey="2" 
href="/timeline">Timeline</a></li><li><a accesskey="3" 
href="/roadmap">Roadmap</a></li><li><a href="/query">View 
Tickets</a></li><li><a accesskey="7" href="/newticket">New 
Ticket</a></li><li><a accesskey="1" href="/wiki">Wiki</a></li><li><a 
accesskey="4" href="/search">Search</a></li><li class="last"><a 
href="/admin">Admin</a></li></ul></div>
<div id="main">




<div id="ctxtnav" class="nav"></div>

<div id="content" class="attachment">


 <h1><a href="/ticket/1241">Ticket #1241</a>: scrollbar.diff</h1>
 <table id="info" summary="Description"><tbody><tr>
   <th scope="col">
    File scrollbar.diff, 0.5 kB 
    (added by jackburton,  24 minutes ago)
   </th></tr><tr>
   <td class="message"></td>
  </tr>
 </tbody></table>
 <div id="preview">
   


<div class="diff"><ul class="entries"><li class="entry">
  <h2>src/kits/interface/ScrollBar.cpp</h2>
  <table class="inline" summary="Differences" cellspacing="0">
   <colgroup><col class="lineno" /><col class="lineno" /><col class="content" 
/></colgroup>
   <thead><tr>
    <th>old</th>
    <th>new</th>
    <th>&nbsp;</th>
   </tr></thead><tbody><tr><th>291</th><th>291</th><td 
class="l"><span>void</span>&nbsp;</td></tr><tr><th>292</th><th>292</th><td 
class="l"><span>BScrollBar::SetValue(float 
value)</span>&nbsp;</td></tr><tr><th>293</th><th>293</th><td 
class="l"><span>{</span>&nbsp;</td></tr></tbody><tbody class="rem"><tr 
class="first"><th>294</th><th>&nbsp;</th><td class="l"><del>&nbsp; &nbsp; 
&nbsp; &nbsp; if (value == 
fValue)</del>&nbsp;</td></tr><tr><th>295</th><th>&nbsp;</th><td 
class="l"><del>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
return;</del>&nbsp;</td></tr><tr class="last"><th>296</th><th>&nbsp;</th><td 
class="l"><del></del>&nbsp;</td></tr></tbody><tbody><tr><th>297</th><th>294</th><td
 class="l"><span>&nbsp; &nbsp; &nbsp; &nbsp; if (value &gt; 
fMax)</span>&nbsp;</td></tr><tr><th>298</th><th>295</th><td 
class="l"><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; value = 
fMax;</span>&nbsp;</td></tr><tr><th>299</th><th>296</th><td 
class="l"><span>&nbsp; &nbsp; &nbsp; &nbsp; if (value &lt; 
fMin)</span>&nbsp;</td></tr><tr><th>300</th><th>297</th><td 
class="l"><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; value = 
fMin;</span>&nbsp;</td></tr><tr><th>301</th><th>298</th><td 
class="l"><span></span>&nbsp;</td></tr></tbody><tbody class="mod"><tr 
class="first"><th>302</th><th>&nbsp;</th><td class="l">&nbsp; &nbsp; &nbsp; 
&nbsp; <del>fV</del>alue = roundf(value);&nbsp;</td></tr><tr 
class="last"><th>&nbsp;</th><th>299</th><td class="r">&nbsp; &nbsp; &nbsp; 
&nbsp; <ins>v</ins>alue = 
roundf(value);&nbsp;</td></tr></tbody><tbody><tr><th>303</th><th>300</th><td 
class="l"><span></span>&nbsp;</td></tr></tbody><tbody class="add"><tr 
class="first"><th>&nbsp;</th><th>301</th><td class="r"><ins>&nbsp; &nbsp; 
&nbsp; &nbsp; if (value == 
fValue)</ins>&nbsp;</td></tr><tr><th>&nbsp;</th><th>302</th><td 
class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
return;</ins>&nbsp;</td></tr><tr><th>&nbsp;</th><th>303</th><td 
class="r"><ins></ins>&nbsp;</td></tr><tr><th>&nbsp;</th><th>304</th><td 
class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; fValue = 
value;</ins>&nbsp;</td></tr><tr class="last"><th>&nbsp;</th><th>305</th><td 
class="r"><ins></ins>&nbsp;</td></tr></tbody><tbody><tr><th>304</th><th>306</th><td
 class="l"><span>&nbsp; &nbsp; &nbsp; &nbsp; 
_UpdateThumbFrame();</span>&nbsp;</td></tr><tr><th>305</th><th>307</th><td 
class="l"><span>&nbsp; &nbsp; &nbsp; &nbsp; 
_UpdateArrowButtons();</span>&nbsp;</td></tr><tr><th>306</th><th>308</th><td 
class="l"><span></span>&nbsp;</td></tr></tbody>
  </table>
 </li>
</ul></div>

 </div>
 <div class="buttons">
  <form method="get" action=""><div id="delete">
   <input type="hidden" name="action" value="delete" />
   <input type="submit" value="Delete attachment" />
  </div></form>
 </div>


</div>
<script type="text/javascript">searchHighlight()</script>
<div id="altlinks"><h3>Download in other formats:</h3><ul><li class="first 
last"><a href="/attachment/ticket/1241/scrollbar.diff?format=raw">Original 
Format</a></li></ul></div>

</div>

<div id="footer">
 <hr />
 <a id="tracpowered" href="http://trac.edgewall.org/";><img 
src="/trac-htdocs/trac_logo_mini.png" height="30" width="107"
   alt="Trac Powered"/></a>
 <p class="left">
  Powered by <a href="/about"><strong>Trac 0.10.3dev</strong></a><br />
  By <a href="http://www.edgewall.org/";>Edgewall Software</a>.
 </p>
 <p class="right">
  Visit the Haiku project at<br /><a 
href="http://haiku-os.org/";>http://haiku-os.org/</a>
 </p>
</div>



 </body>
</html>

Other related posts: