Problem Description:
In The Saloon we were discussing a few interface design points and upon showing off my ideas in Ultimate Jigsaw I came to find that the game was no longer playable due to issues with icon operations. Upon investigating which version it became an issue with, I found something even more upsetting.
Unfortunately, the icon operations in Ultimate Jigsaw are numerous and heavily condensed, I don't quite have the full source at my disposal, and I don't have the time to set up tests, so I can't give too much information through code examples. I can explain the way that connecting pieces works, if that helps.
When a piece connects to another piece, it will determine whether or not the old piece(s) plus the new piece(s) will be larger vertically or horizontally. If not, it will simply Blend() the new piece(s) into the correct position on the old piece(s) icon. If so, will create a new blank icon to correctly accommodate both and then blend both the old and new piece(s) into the correct positions on the new icon, discarding the leftovers.
Version Testing:
482: Game plays fine, runs fine, all is well.
483: Game plays fine but as the size of the icons grow, i.e., the more pieces you connect together vertically and/or horizontally, the slower and slower the operations work. It's quite noticeable and compounds quickly.
484 & 485: Game doesn't play at all. If you connect pieces together, they don't seem to Scale() properly and end up cutting off the ends of pieces.
EDIT: I dug out my laptop and a replacement monitor and set it up on the washer just for you. Here's the portion of the source that pertains to this issue.
Connect(client/C)
for(var/Piece/P in C.screen)
if(P==src || !length(P.connected&connectable) || rotation!=P.rotation || map_loc != P.map_loc) continue
var{newx;newy;ix;iy;sx;sy;nx;ny;ps=C.piece_size+C.piece_split;colnum=(col-P.col)*ps;rownum=(row-P.row)*ps;icon/i=new(P.icon)}
switch(rotation)
if(0) {newx=P.pixel_locx+colnum;newy=P.pixel_locy+rownum;ix=colnum;iy=rownum}
if(1) {newx=P.pixel_locx+rownum;newy=((P.pixel_locy+P.sizey)-colnum)-sizey;ix=rownum;iy=(P.sizey-colnum)-sizey}
if(2) {newx=((P.pixel_locx+P.sizex)-colnum)-sizex;newy=((P.pixel_locy+P.sizey)-rownum)-sizey;ix=(P.sizex-colnum)-sizex;iy=(P.sizey-rownum)-sizey}
if(3) {newx=((P.pixel_locx+P.sizex)-rownum)-sizex;newy=P.pixel_locy+colnum;ix=(P.sizex-rownum)-sizex;iy=colnum}
if(!(pixel_locx<newx+C.piece_split&&pixel_locx>newx-C.piece_split)||!(pixel_locy<newy+C.piece_split&&pixel_locy>newy-C.piece_split)) continue
i.DrawBox(null,1,1,i.Width(),i.Height())
if(ix<0) sx=abs(ix);if(iy<0) sy=abs(iy)
if(sx||sy) {i.Scale(i.Width()+sx,i.Height()+sy);P.PixelMove(C,sx ? ix : 0, sy ? iy : 0,TRUE)}
nx=max(ix+sizex,sizex,i.Width());ny=max(iy+sizey,sizey,i.Height());i.Scale(nx,ny)
i.Blend(new/icon(P.icon),ICON_OVERLAY)
if(sx)i.Shift(EAST,sx);if(sy)i.Shift(NORTH,sy)
i.Blend(new/icon(icon),ICON_OVERLAY,sx?1:ix+1,sy?1:iy+1);P.Icon(C,null,i)
world << sound('click.ogg')
var/list/Pconnectable = P.connectable&connectable+P.connectable|connectable
var/list/PConnected = P.connected&connected+P.connected|connected
Pconnectable -= Pconnectable&PConnected;P.connectable=Pconnectable;P.connected=PConnected
P.col=min(col,P.col);P.row=min(row,P.row)
"The problem is somewhere in there."