Skip to content

Commit fe45d69

Browse files
committed
Add logs to calculating drawable bounds
1 parent cf05fc8 commit fe45d69

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

media-placeholders/src/main/java/org/wordpress/aztec/placeholders/PlaceholderManager.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import android.graphics.drawable.Drawable
77
import android.text.Editable
88
import android.text.Layout
99
import android.text.Spanned
10+
import android.util.Log
1011
import android.view.MotionEvent
1112
import android.view.View
1213
import android.view.ViewTreeObserver
@@ -329,8 +330,11 @@ class PlaceholderManager(
329330
val editorWidth = if (aztecText.width > 0) {
330331
aztecText.width - aztecText.paddingStart - aztecText.paddingEnd
331332
} else aztecText.maxImagesWidth
333+
Log.d(TAG, "Updating drawable bounds - editor width: $editorWidth")
332334
if (drawable?.bounds?.right != editorWidth) {
335+
Log.d(TAG, "Bounds before - right - ${drawable?.bounds?.right} - bottom - ${drawable?.bounds?.bottom}")
333336
drawable?.setBounds(0, 0, adapter.calculateWidth(attrs, editorWidth), adapter.calculateHeight(attrs, editorWidth))
337+
Log.d(TAG, "Bounds after - right - ${drawable?.bounds?.right} - bottom - ${drawable?.bounds?.bottom}")
334338
}
335339
}
336340

@@ -465,6 +469,7 @@ class PlaceholderManager(
465469
data class Placeholder(val elementPosition: Int, val uuid: String)
466470

467471
companion object {
472+
private const val TAG = "PlaceholderManager"
468473
private const val DEFAULT_HTML_TAG = "placeholder"
469474
private const val UUID_ATTRIBUTE = "uuid"
470475
private const val TYPE_ATTRIBUTE = "type"

0 commit comments

Comments
 (0)