Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

12
LINES

< > BotCompany Repo | #191 // Scrolling for editor

Document

1  
How can we add scrolling to editor 2.1 (#185)? We need to update scrollX and scrollX as soon as the cursor moves out of the screen.
2  
3  
So it's something like this:
4  
5  
  if curX < scrollX then scrollX = curX end
6  
  if curY < scrollY then scrollY = curY end
7  
  if curX >= scrollX+displayCols then scrollX = curX-displayCols end
8  
  if curY >= scrollY+displayRows then scrollY = curY-displayRows end
9  
  
10  
Now we just insert that at the appropriate place in the source, and we're done.
11  
12  
Note: Did it, see #192 (now also automatically included in #185).

download  show line numbers   

Travelled to 12 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Image recognition results

Recognizer Recognition Result Visualize Recalc
#308 549 [visualize]

Snippet ID: #191
Snippet name: Scrolling for editor
Eternal ID of this version: #191/1
Text MD5: 9dd20c6c924f92bc6b553ac7a35d9bef
Author: stefan
Category:
Type: Document
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2014-01-19 02:15:10
Source code size: 549 bytes / 12 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 752 / 179
Referenced in: [show references]