add download progress, improbable cloud browser, lock touch when pencil is down on iOS

This commit is contained in:
2018-01-04 00:02:28 +00:00
parent 01370642a1
commit 5feb3acb1d
10 changed files with 120 additions and 37 deletions

View File

@@ -30,6 +30,7 @@
@end
//std::map<
bool pen_down = false;
int t_count = 0;
glm::vec2 t_pos;
int lock_count = 0;
@@ -194,6 +195,8 @@ NSThread* lock_thread;
float scale = self.view.contentScaleFactor;
kEventSource source = touch.type == UITouchType::UITouchTypeStylus ? kEventSource::Stylus : kEventSource::Touch;
if (source == kEventSource::Stylus)
pen_down = true;
[self async_lock];
App::I.mouse_down(0, touchLocation.x * scale, touchLocation.y * scale, touch.force, source);
[self async_unlock];
@@ -220,7 +223,14 @@ NSThread* lock_thread;
}
[self async_lock];
if (n == 2)
if (pen_down)
{
if (t0.type == UITouchType::UITouchTypeStylus)
App::I.mouse_move(p0.x, p0.y, t0.force, kEventSource::Stylus);
if (t1.type == UITouchType::UITouchTypeStylus)
App::I.mouse_move(p1.x, p1.y, t1.force, kEventSource::Stylus);
}
else if (n == 2)
{
if (t_count == 1)
{
@@ -258,6 +268,7 @@ NSThread* lock_thread;
float scale = self.view.contentScaleFactor;
kEventSource source = touch.type == UITouchType::UITouchTypeStylus ? kEventSource::Stylus : kEventSource::Touch;
pen_down = false;
[self async_lock];
if (t_count == 2)