예제 #1
0
파일: SkView.cpp 프로젝트: BBKeeper/Skia
void SkView::DoClickUp(Click* click, int x, int y)
{
	SkASSERT(click);

	SkView* target = (SkView*)SkEventSink::FindSink(click->fTargetID);
	if (target == NULL)
		return;

	click->fIPrev = click->fICurr;
	click->fICurr.set(x, y);

	click->fPrev = click->fCurr;
	click->fCurr.iset(x, y);
	target->globalToLocal(&click->fCurr);

	click->fState = Click::kUp_State;
	target->onClick(click);
}
예제 #2
0
void SkView::DoClickDown(Click* click, int x, int y)
{
    SkASSERT(click);

    SkView* target = (SkView*)SkEventSink::FindSink(click->fTargetID);
    if (NULL == target) {
        return;
    }

    click->fIOrig.set(x, y);
    click->fICurr = click->fIPrev = click->fIOrig;

    click->fOrig.iset(x, y);
    if (!target->globalToLocal(&click->fOrig)) {
        // no history to let us recover from this failure
        return;
    }
    click->fPrev = click->fCurr = click->fOrig;

    click->fState = Click::kDown_State;
    target->onClick(click);
}
예제 #3
0
void SkView::DoClickUp(Click* click, int x, int y)
{
    SkASSERT(click);

    SkView* target = (SkView*)SkEventSink::FindSink(click->fTargetID);
    if (NULL == target) {
        return;
    }

    click->fIPrev = click->fICurr;
    click->fICurr.set(x, y);

    click->fPrev = click->fCurr;
    click->fCurr.iset(x, y);
    if (!target->globalToLocal(&click->fCurr)) {
        // on failure pretend the mouse didn't move
        click->fCurr = click->fPrev;
    }

    click->fState = Click::kUp_State;
    target->onClick(click);
}
예제 #4
0
파일: SkView.cpp 프로젝트: 03050903/skia
void SkView::DoClickMoved(Click* click, int x, int y, unsigned modi) {
    SkASSERT(click);

    SkView* target = (SkView*)SkEventSink::FindSink(click->fTargetID);
    if (nullptr == target) {
        return;
    }

    click->fIPrev = click->fICurr;
    click->fICurr.set(x, y);

    click->fPrev = click->fCurr;
    click->fCurr.iset(x, y);
    if (!target->globalToLocal(&click->fCurr)) {
        // on failure pretend the mouse didn't move
        click->fCurr = click->fPrev;
    }

    click->fState = Click::kMoved_State;
    click->fModifierKeys = modi;
    target->onClick(click);
}