File tree Expand file tree Collapse file tree 2 files changed +25
-5
lines changed
compose-dnd/src/commonMain/kotlin/com/mohamedrejeb/compose/dnd Expand file tree Collapse file tree 2 files changed +25
-5
lines changed Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2023, Mohamed Ben Rejeb and the Compose Dnd project contributors
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
116package com.mohamedrejeb.compose.dnd
217
318import androidx.compose.runtime.staticCompositionLocalOf
Original file line number Diff line number Diff line change @@ -146,15 +146,17 @@ private data class DropTargetNode<T>(
146146 override fun onAttach () {
147147 isShadow = currentValueOf(LocalDragAndDropInfo ).isShadow
148148
149- if (isShadow)
149+ if (isShadow) {
150150 return
151+ }
151152
152153 state.addDropTarget(dropTargetState)
153154 }
154155
155156 override fun onPlaced (coordinates : LayoutCoordinates ) {
156- if (isShadow)
157+ if (isShadow) {
157158 return
159+ }
158160
159161 state.addDropTarget(dropTargetState)
160162
@@ -166,22 +168,25 @@ private data class DropTargetNode<T>(
166168 }
167169
168170 override fun onRemeasured (size : IntSize ) {
169- if (isShadow)
171+ if (isShadow) {
170172 return
173+ }
171174
172175 dropTargetState.size = size.toSize()
173176 }
174177
175178 override fun onReset () {
176- if (isShadow)
179+ if (isShadow) {
177180 return
181+ }
178182
179183 state.removeDropTarget(key)
180184 }
181185
182186 override fun onDetach () {
183- if (isShadow)
187+ if (isShadow) {
184188 return
189+ }
185190
186191 state.removeDropTarget(key)
187192 }
You can’t perform that action at this time.
0 commit comments