if(tbox.width > tbox.height) {
                                    dimenDiff = sbox.width - tbox.width;
                                    offset = tbox.x - sbox.x;
                                }
                                else {