Skip to content

Instantly share code, notes, and snippets.

Created October 12, 2016 19:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/7a503c73a07e91f75a9c6274fec104cb to your computer and use it in GitHub Desktop.
Save anonymous/7a503c73a07e91f75a9c6274fec104cb to your computer and use it in GitHub Desktop.
--- TileScrollView.m 2013-07-04 17:38:38.000000000 +0300
+++ TileScrollView.m.new 2016-08-22 22:29:31.010630626 +0300
@@ -73,7 +73,7 @@
- (void)setDocument:docu
{ int i;
- document = docu;
+ document = docu;
[resPopupListButton setTarget:self];
[resPopupListButton setAction:@selector(changeScale:)];
@@ -83,7 +83,7 @@
/* created: 1993-07-04
* modified: 2012-08-13
- *
+ *
* increment and decrement an entry in the popup menu
*/
- (void)zoomIn:sender
@@ -93,17 +93,17 @@
NSRect bRect;
for (row=0; row<[resPopupListButton numberOfItems]; row++)
- if (Diff((VFloat)[[resPopupListButton itemAtIndex:row] tag] / 100.0, oldScaleFactor) < 0.001)
- break;
- row++;
- if (row >= [resPopupListButton numberOfItems])
- return;
- [resPopupListButton setTitle:[resPopupListButton itemTitleAtIndex:row]];
+ if (Diff((float)[(TileScrollView*)[resPopupListButton itemAtIndex:row] tag] / 100.0, oldScaleFactor) < 0.001)
+ break;
+ row++;
+ if (row >= [resPopupListButton numberOfItems])
+ return;
+ [resPopupListButton setTitle:[resPopupListButton itemTitleAtIndex:row]];
- scaleFactor = [[resPopupListButton itemAtIndex:row] tag] / 100.0;
+ scaleFactor = [(TileScrollView*)[resPopupListButton itemAtIndex:row] tag] / 100.0;
- bRect = [[self documentView] visibleRect];
- center.x = bRect.origin.x+bRect.size.width/2.0;
+ bRect = [[self documentView] visibleRect];
+ center.x = bRect.origin.x+bRect.size.width/2.0;
center.y = bRect.origin.y+bRect.size.height/2.0;
[document scale:NSMakeSize(scaleFactor/oldScaleFactor, scaleFactor/oldScaleFactor) withCenter:center];
@@ -119,13 +119,13 @@
NSRect bRect;
for (row=0; row<[resPopupListButton numberOfItems]; row++)
- if (Diff((float)[[resPopupListButton itemAtIndex:row] tag] / 100.0, oldScaleFactor) < 0.001)
+ if (Diff((float)[(TileScrollView*)[resPopupListButton itemAtIndex:row] tag] / 100.0, oldScaleFactor) < 0.001)
break;
row--;
if (row < 0)
return;
- scaleFactor = (VFloat)[[resPopupListButton itemAtIndex:row] tag] / 100.0;
+ scaleFactor = [(TileScrollView*)[resPopupListButton itemAtIndex:row] tag] / 100.0;
#if !defined(GNUSTEP_BASE_VERSION) && !defined(__APPLE__) // OpenStep 4.2
bRect = [[self documentView] bounds];
@@ -171,7 +171,7 @@
/* get row of popup relating to current scale */
for (row=0; row<[resPopupListButton numberOfItems]; row++)
- if (Diff((VFloat)[[resPopupListButton itemAtIndex:row] tag] / 100.0, oldScaleFactor) < 0.001)
+ if (Diff((float)[(TileScrollView*)[resPopupListButton itemAtIndex:row] tag] / 100.0, oldScaleFactor) < 0.001)
break;
row++;
if (row >= [resPopupListButton numberOfItems])
@@ -180,13 +180,13 @@
/* climb up the popup entries and get the new row */
for ( ; scale > 0.0 && row<[resPopupListButton numberOfItems]-1; row++ )
{
- scaleFactor = [[resPopupListButton itemAtIndex:row] tag] / 100.0;
+ scaleFactor = [(TileScrollView*)[resPopupListButton itemAtIndex:row] tag] / 100.0;
if (scaleFactor / oldScaleFactor >= scale)
break;
}
[resPopupListButton setTitle:[resPopupListButton itemTitleAtIndex:row]];
- scaleFactor = [[resPopupListButton itemAtIndex:row] tag] / 100.0;
+ scaleFactor = [(TileScrollView*)[resPopupListButton itemAtIndex:row] tag] / 100.0;
[document scale:NSMakeSize(scaleFactor/oldScaleFactor, scaleFactor/oldScaleFactor) withCenter:center];
oldScaleFactor = scaleFactor;
@@ -229,7 +229,7 @@
{ int row = -1;
for (row=0; row<[resPopupListButton numberOfItems]; row++)
- if (Diff((float)[[resPopupListButton itemAtIndex:row] tag] / 100.0, scaleFactor) < 0.001)
+ if (Diff((float)[(TileScrollView*)[resPopupListButton itemAtIndex:row] tag] / 100.0, oldScaleFactor) < 0.001)
[resPopupListButton selectItemAtIndex:row];
#if !defined(GNUSTEP_BASE_VERSION) && !defined(__APPLE__) // OpenStep 4.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment