Graphics copyArea overflow check bails out of copying pixels if there is overflow. The spec says ""If a portion of the source rectangle lies outside the bounds of the component, or is obscured by another window or component, {@code copyArea} *will be unable to copy* the associated pixels"
which suggests that we should always copy the parts inside the bounds and never the parts outside the bounds but it seems currently, in the case of overflow it no longer copies any pixels, including the parts that are inside. So, the fix clips the copyarea region to clip bounds so it will only affect pixels within the valid bounds, and any pixels outside will be ignored. ------------- Commit messages: - 8357299: Graphics copyArea doesn't copy any pixels when there is overflow Changes: https://git.openjdk.org/jdk/pull/25340/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25340&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8357299 Stats: 74 lines in 2 files changed: 62 ins; 5 del; 7 mod Patch: https://git.openjdk.org/jdk/pull/25340.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25340/head:pull/25340 PR: https://git.openjdk.org/jdk/pull/25340