Tk Source Code

Check-in [45ebf58a]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Prevent a faint outline from appearing when downscaling Retina captures
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | bug-df4b603950-alt
Files: files | file ages | folders
SHA3-256: 45ebf58a93b5b7e6ee4a32a698d255c1cdd88273976a044ea1cec403ff7d5a54
User & Date: chrstphrchvz 2025-08-16 01:36:36.652
Context
2025-08-16
01:36
Prevent a faint outline from appearing when downscaling Retina captures Leaf check-in: 45ebf58a user: chrstphrchvz tags: bug-df4b603950-alt
01:33
Alternative fix for CreateCGImageFromDrawableRect() returning smaller image than requested. See [f215a9fdaa]. check-in: 84c2ba4f user: chrstphrchvz tags: bug-df4b603950-alt
Changes
Unified Diff Ignore Whitespace Patch
Changes to macosx/tkMacOSXImage.c.
687
688
689
690
691
692
693


694
695
696
697
698
699
700
		width * dstScaleFactor,
		height * dstScaleFactor,
		CGImageGetBitsPerComponent(cg_image),
		CGImageGetBitsPerPixel(cg_image) * width * dstScaleFactor / 8,
		colorspace,
		CGImageGetAlphaInfo(cg_image));
	CGColorSpaceRelease(colorspace);


	if (cg_context) {
	    // Draw the source at an offset in our context (resizing it to fit).
	    CGContextDrawImage(cg_context, rect, cg_image);
	    // We will return the image we just drew.
	    result = CGBitmapContextCreateImage(cg_context);
	    CGContextRelease(cg_context);
	}







>
>







687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
		width * dstScaleFactor,
		height * dstScaleFactor,
		CGImageGetBitsPerComponent(cg_image),
		CGImageGetBitsPerPixel(cg_image) * width * dstScaleFactor / 8,
		colorspace,
		CGImageGetAlphaInfo(cg_image));
	CGColorSpaceRelease(colorspace);
	// Prevent a faint outline from appearing when downscaling Retina captures; possibly also faster
	CGContextSetInterpolationQuality(cg_context, kCGInterpolationNone);
	if (cg_context) {
	    // Draw the source at an offset in our context (resizing it to fit).
	    CGContextDrawImage(cg_context, rect, cg_image);
	    // We will return the image we just drew.
	    result = CGBitmapContextCreateImage(cg_context);
	    CGContextRelease(cg_context);
	}