Changes between Initial Version and Version 1 of Ticket #16476, comment 6
- Timestamp:
- Nov 23, 2020, 8:17:59 PM (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #16476, comment 6
initial v1 2 2 3 3 before SetText() 4 5 {{{ 4 6 BRect(l:4.0, t:4.0, r:1019.0, b:-4.0) 5 7 BRect(l:4.0, t:31.0, r:1019.0, b:23.0) 6 8 BRect(l:4.0, t:58.0, r:1019.0, b:50.0) 9 }}} 7 10 after SetText() 11 {{{ 8 12 BRect(l:0.0, t:0.0, r:60.0, b:13.0) 9 13 BRect(l:0.0, t:0.0, r:59.0, b:13.0) 10 14 BRect(l:0.0, t:0.0, r:59.0, b:13.0) 15 }}} 11 16 12 17 So you can see that on BeOS it is fixing up of the text rect. Here is the same program running on Haiku: 13 18 14 19 before SetText() 20 {{{ 15 21 BRect(l:4.0, t:4.0, r:1361.0, b:-4.0) 16 22 BRect(l:4.0, t:36.0, r:1361.0, b:28.0) 17 23 BRect(l:4.0, t:68.0, r:1361.0, b:60.0) 24 }}} 18 25 after SetText() 26 {{{ 19 27 BRect(l:0.0, t:0.0, r:0.0, b:18.0) 20 28 BRect(l:0.0, t:0.0, r:0.0, b:18.0) 21 29 BRect(l:0.0, t:0.0, r:0.0, b:18.0) 30 }}} 22 31 23 32 Aha! On Haiku we don't try to fix the text rect if it is 0 width. So this is the reason that we are getting this odd vertical scrolling on Haiku. … … 26 35 27 36 before SetText() 37 {{{ 28 38 BRect(l:4.0, t:4.0, r:1361.0, b:-4.0) 29 39 BRect(l:4.0, t:36.0, r:1361.0, b:28.0) 30 40 BRect(l:4.0, t:68.0, r:1361.0, b:60.0) 41 }}} 31 42 after SetText() 43 {{{ 32 44 BRect(l:3.0, t:0.0, r:193.0, b:18.0) 33 45 BRect(l:3.0, t:0.0, r:193.0, b:18.0) 34 46 BRect(l:3.0, t:0.0, r:193.0, b:18.0) 47 }}} 35 48 36 49 Progress! I'll get into the change I made in a minute. The output is not exactly the same as BeOS, but it's close. It seems that BeOS will set the text rect to the width of the string, while in Haiku we set it to the width of the text view instead. That difference aside, once the text rect is not initially 0 width, the BTextView size is fixed up properly and displays correctly!