Skip to content

Commit

Permalink
y-axis shifting while zoom out fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Mustafa Urgupluoglu committed Apr 3, 2019
1 parent 26b4823 commit f3f3c6f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import com.murgupluoglu.seatview.Seat
import kotlinx.android.synthetic.main.activity_main.*
import org.json.JSONArray
import org.json.JSONObject
import java.util.HashMap
import java.util.*

/**
* Created by Mustafa Urgupluoglu on 3.04.2019.
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/layout/activity_mock.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class SeatView : View {
}
invalidate()
} else {
// click blank area
// clicked blank area
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.murgupluoglu.seatview
import android.content.Context
import android.graphics.Path
import android.graphics.RectF
import android.util.Log
import java.math.BigDecimal

class SeatViewConfig(val context: Context) {
Expand Down Expand Up @@ -277,7 +276,6 @@ class SeatViewConfig(val context: Context) {
if (seatViewRect.left < windowRect.left + seatNamesBarWidth) {
xOffset -= moveX
xOffset = xOffset.round(2)
Log.e("TAG", xOffset.toString())
}
} else {
if (seatViewRect.right > windowRect.right) {
Expand Down Expand Up @@ -337,6 +335,12 @@ class SeatViewConfig(val context: Context) {

xOffset = touchX - (virtualWidth * ratioX).toInt()
yOffset = touchY - (virtualHeight * ratioY).toInt()
if(yOffset > yOffsetDefault){
yOffset = yOffsetDefault
}
if(xOffset > xOffsetDefault){
xOffset = xOffsetDefault
}
}

fun isSafeSelect(rowIndex: Int, columnIndex: Int): Boolean {
Expand Down

0 comments on commit f3f3c6f

Please sign in to comment.