mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 23:32:09 +00:00
Finally have the scaling working perfectly(?).
I had to hack around problems in GNUstep's bounds implementation (I don't know if they're bugs or design limitations), but the fix was just a matter of making sure the bounds matrix was correct: force the scale to 1 before adjusting bounds, and then make sure the translation is scaled afterwards.
This commit is contained in:
parent
ad0cd004b7
commit
d4d8c50c85
1 changed files with 9 additions and 8 deletions
|
@ -117,13 +117,6 @@ initWithFrame:
|
||||||
return scale;
|
return scale;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSRect) adjustScroll: (NSRect)newVisible
|
|
||||||
{
|
|
||||||
Sys_Printf ("newVisible: %g %g %g %g\n",
|
|
||||||
newVisible.origin.x, newVisible.origin.y,
|
|
||||||
newVisible.size.width, newVisible.size.height);
|
|
||||||
return newVisible;
|
|
||||||
}
|
|
||||||
|
|
||||||
-setOrigin:(NSPoint)pt scale:(float) sc
|
-setOrigin:(NSPoint)pt scale:(float) sc
|
||||||
{
|
{
|
||||||
|
@ -154,12 +147,20 @@ initWithFrame:
|
||||||
// size this view
|
// size this view
|
||||||
[self setFrame: sframe];
|
[self setFrame: sframe];
|
||||||
if (_boundsMatrix) {
|
if (_boundsMatrix) {
|
||||||
//FIXME workaround for a bug in GNUstep
|
//FIXME workaround for a bug (?) in GNUstep
|
||||||
NSAffineTransformStruct t = [_boundsMatrix transformStruct];
|
NSAffineTransformStruct t = [_boundsMatrix transformStruct];
|
||||||
t.m11 = t.m22 = 1;
|
t.m11 = t.m22 = 1;
|
||||||
|
t.m12 = t.m21 = 0;
|
||||||
[_boundsMatrix setTransformStruct: t];
|
[_boundsMatrix setTransformStruct: t];
|
||||||
}
|
}
|
||||||
[self setBounds: bounds];
|
[self setBounds: bounds];
|
||||||
|
if (_boundsMatrix) {
|
||||||
|
//FIXME workaround for a bug (?) in GNUstep
|
||||||
|
NSAffineTransformStruct t = [_boundsMatrix transformStruct];
|
||||||
|
t.tX *= scale;
|
||||||
|
t.tY *= scale;
|
||||||
|
[_boundsMatrix setTransformStruct: t];
|
||||||
|
}
|
||||||
|
|
||||||
//[self setPostsFrameChangedNotifications:YES];
|
//[self setPostsFrameChangedNotifications:YES];
|
||||||
//[self setPostsBoundsChangedNotifications:YES];
|
//[self setPostsBoundsChangedNotifications:YES];
|
||||||
|
|
Loading…
Reference in a new issue