• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Shadows when resizing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Shadows when resizing


  • Subject: Shadows when resizing
  • From: Josh Anon <email@hidden>
  • Date: Mon, 20 Oct 2003 08:36:03 -0700

Hi everyone,
I have an image I composite in to a view. The view is mainly transparent, and the image has transparency, too. The first time through, everything works nicely with this drawing code:

- (void)drawRect:(NSRect)rect {
NSRectFillUsingOperation(rect, NSCompositeClear);
[self _drawImageProportionallyInRect_:rect];
//other stuff I've commented out
}

- (void)_drawImageProportionallyInRect_:(NSRect)rect {
if (_image) {
//do some calculations to get the dst/src rect
[NSGraphicsContext saveGraphicsState];
CGSize sz;
sz.width = 1; sz.height = 1;
CGContextSetShadowWithColor((CGContextRef)[NSGraphicsContext currentContext],
sz,
1.0,
NULL);

[_image drawInRect:dstRect fromRect:srcRect operation:NSCompositeSourceOver fraction:1.0];

[NSGraphicsContext restoreGraphicsState];
}
}

However, as soon as I resize the window/view, the image gets a drop shadow. I explicitly turn shadows off, yet I can't make the shadows go away. Even more interesting, when I set _image to nil, so that the only thing that happens is a NSRectFillUsingOperation(..,NSCompositeClear), I see the drop shadow from the previous image.

Any ideas?

Thanks,
Josh

---
Josh Anon
Studio Tools, Pixar Animation Studios
email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: UI Controls in menubar
  • Next by Date: OpenGL Shadows
  • Previous by thread: Re: UI Controls in menubar
  • Next by thread: OpenGL Shadows
  • Index(es):
    • Date
    • Thread