Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dkrivoruchko committed Sep 28, 2021
1 parent 4ab6c5f commit efd7a84
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ class BitmapCapture(
private fun getScreenSizeCompat(): Point =
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) {
@Suppress("DEPRECATION")
val metrics = DisplayMetrics().also { display.getMetrics(it) }
Point(metrics.widthPixels, metrics.heightPixels)
Point().also { display.getRealSize(it) }
} else {
val bounds = windowContext().getSystemService(WindowManager::class.java).maximumWindowMetrics.bounds
Point(bounds.width(), bounds.height())
Expand Down Expand Up @@ -173,6 +172,7 @@ class BitmapCapture(
@SuppressLint("WrongConstant")
private fun startDisplayCapture() {
val screenSize = getScreenSizeCompat()
val screenSize2 = Point().also { display.getRealSize(it) }

val screenSizeX: Int
val screenSizeY: Int
Expand Down

0 comments on commit efd7a84

Please sign in to comment.