Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ class SugiyamaLayoutManager @JvmOverloads constructor(private val context: Conte
root[i][n] = n
align[i][n] = n
sink[i][n] = n
shift[i][n] = java.lang.Float.MAX_VALUE
shift[i][n] = 0f
x[i][n] = java.lang.Float.MIN_VALUE
blockWidth[i][n] = 0f
}
Expand Down Expand Up @@ -596,9 +596,9 @@ class SugiyamaLayoutManager @JvmOverloads constructor(private val context: Conte
// the first median
val median = floor((adjNodes.size + 1) / 2.0).toInt()
val medianCount = if (adjNodes.size % 2 == 1) 1 else 2

val medianIndexList = if (leftToRight) (0 until medianCount) else (0 until medianCount).reversed()
// for all median neighbours in direction of H
(0 until medianCount).forEach { count ->
medianIndexList.forEach { count ->
val m = adjNodes[median + count - 1]
val posM = pos(m)

Expand Down
6 changes: 5 additions & 1 deletion sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ android {
}
}

packagingOptions {
pickFirst 'META-INF/library_release.kotlin_module'
}

compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
Expand All @@ -34,7 +38,7 @@ dependencies {
implementation "androidx.recyclerview:recyclerview:1.2.0"
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.0-beta01'
implementation 'com.otaliastudios:zoomlayout:1.8.0'
implementation 'com.otaliastudios:zoomlayout:1.9.0'
implementation 'com.google.android.material:material:1.3.0'
implementation project(path: ':graphview')
}