make text and drawings the same width
[?]
May 20, 2022, 5:02 AM
LUNH47XXUUITDLE6NBI3J7GJQWQ45OQAGXY2HJI4HRPOR2GUULPACDependencies
- [2]
7DPPMI2Uanother integer coordinate - [3]
DAENUOGVeliminate assumptions that line length == size in bytes - [4]
V5TP27FPctrl-+ and ctrl-- to adjust font size - [5]
WDWXNW7Vslightly strange way to move points - [6]
JVRL5TWLstore device-independent coordinates inside drawings - [7]
2KRK3OBVdon't rely on defaults - [8]
YKRF5V3Zstarting to load/save - [9]
2FBLO5FHadjust window size - [10]
JCSLDGAHbeginnings of support for multiple shapes - [11]
FJ4L6N74draw lines by default - [12]
YJGADSGKdelete unused arg - [13]
WTDKUACNrectangle and square shapes - [14]
4C375P53this is a bit clearer - [15]
AVQ5MC5Dfinish uppercasing all globals - [16]
NYQ7HD4Dmove - [17]
BLWAYPKVextract a module - [18]
M36DBSDEbit more polish to help screen - [19]
252M2QMDforgot to move this special case out - [20]
DLQMM265scroll past first page - [21]
PWHZPJJMalways show current filename in window title - [22]
W4UVZETR2 regressions: - [23]
UWNHC4AAredo y computations - [24]
XNFTJHC4split keyboard handling between Text and Drawing - [25]
2C7CTIQYmake space for multiple kinds of width - [26]
HYEAFRZ2split mouse_pressed events between Text and Drawing - [27]
VHQCNMARseveral more modules - [*]
OTIBCAUJlove2d scaffold
Change contents
- replacement in main.lua at line 49
-- All drawings span 100% of some conceptual 'page width' and divide it up-- into 256 parts. `Drawing_width` describes their width in pixels.Drawing_width = nil -- pixelsLine_width = nil -- maximum width available to either text or drawings, in pixels - replacement in main.lua at line 64
Drawing_width = math.floor(Screen_width/2/40)*40Line_width = math.floor(Screen_width/2/40)*40 - replacement in main.lua at line 130
y = Text.draw(line, Drawing_width, line_index, Cursor_line, Cursor_pos)y = Text.draw(line, Line_width, line_index, Cursor_line, Cursor_pos) - edit in drawing.lua at line 5
-- All drawings span 100% of some conceptual 'page width' and divide it up-- into 256 parts. - replacement in drawing.lua at line 9
if pmx < 16+Drawing_width and pmy > line.y and pmy < line.y+Drawing.pixels(line.h) thenif pmx < 16+Line_width and pmy > line.y and pmy < line.y+Drawing.pixels(line.h) then - replacement in drawing.lua at line 11
love.graphics.rectangle('line', 16,line.y, Drawing_width,Drawing.pixels(line.h))love.graphics.rectangle('line', 16,line.y, Line_width,Drawing.pixels(line.h)) - replacement in drawing.lua at line 13
icon[Current_drawing_mode](16+Drawing_width-20, line.y+4)icon[Current_drawing_mode](16+Line_width-20, line.y+4) - replacement in drawing.lua at line 15
icon[Previous_drawing_mode](16+Drawing_width-20, line.y+4)icon[Previous_drawing_mode](16+Line_width-20, line.y+4) - replacement in drawing.lua at line 183
return y >= drawing.y and y < drawing.y + Drawing.pixels(drawing.h) and x >= 16 and x < 16+Drawing_widthreturn y >= drawing.y and y < drawing.y + Drawing.pixels(drawing.h) and x >= 16 and x < 16+Line_width - replacement in drawing.lua at line 325
Drawing_width = Drawing_width/ZoomLine_width = Line_width/Zoom - replacement in drawing.lua at line 327
Drawing_width = Drawing_width*ZoomLine_width = Line_width*Zoom - replacement in drawing.lua at line 329
Drawing_width = Drawing_width/ZoomLine_width = Line_width/Zoom - replacement in drawing.lua at line 331
Drawing_width = Drawing_width*ZoomLine_width = Line_width*Zoom - replacement in drawing.lua at line 333
Drawing_width = Drawing_width/ZoomLine_width = Line_width/Zoom - replacement in drawing.lua at line 335
Drawing_width = Drawing_width*ZoomLine_width = Line_width*Zoom - replacement in drawing.lua at line 693
return math.floor(n*Drawing_width/256)return math.floor(n*Line_width/256) - replacement in drawing.lua at line 696
return math.floor(n*256/Drawing_width)return math.floor(n*256/Line_width)